Browser MMO Video #20

Location of the Videos
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video #20

Post by hallsofvallhalla »

you dont have a location. Add a field called location then add whatever location you are at, or change the line

Code: Select all

$invinfo="SELECT * from store where amount > 0 AND location = '$playerinfo3[location]'";
to this

Code: Select all

$invinfo="SELECT * from store where amount > 0";
cubanelite
Posts: 12
Joined: Thu Nov 18, 2010 3:12 am

Re: Video #20

Post by cubanelite »

well that was simple... i'm sorry, but i still have 1 more error...
every time i buy a minor, or a major potion of healing it automatically buys a major, so if i click on minor healing potion it buys a major healing potion, and puts that in my inventory... please help. thanks
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video #20

Post by hallsofvallhalla »

add some randid to them, you just have 0. they are there to instantiate between the two.
cubanelite
Posts: 12
Joined: Thu Nov 18, 2010 3:12 am

Re: Video #20

Post by cubanelite »

once again thank you! everything is working now, but how do i only have the store in one town, and then the store not be in the next one. So if I have a sword shop in one town it wont be in another one, instead there will be other kinds of stores. Any ideas on how to do this?
User avatar
hallsofvallhalla
Site Admin
Posts: 12026
Joined: Wed Apr 22, 2009 11:29 pm

Re: Video #20

Post by hallsofvallhalla »

yes it is already setup for it. Make sure your store table has location. The code checks to see if the item location and player location matches.
Shihonoryu
Posts: 255
Joined: Sun Dec 12, 2010 7:30 am

Re: Video #20

Post by Shihonoryu »

You dont seem happy in this video :(
User avatar
62896dude
Posts: 516
Joined: Thu Jan 20, 2011 2:39 am

Re: Video #20

Post by 62896dude »

Hey there, ive got a problem.. I am getting an error code that reads:

( ! ) Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'root'@'localhost' (using password: YES) in C:\wamp\www\HPMMORPG\connect.php on line 3
Call Stack
# Time Memory Function Location
1 0.0010 375856 {main}( ) ..\register.php:0
2 0.0017 379456 include( 'C:\wamp\www\HPMMORPG\connect.php' ) ..\register.php:2
3 0.0017 379648 mysql_connect ( ) ..\connect.php:3
Could not connect to db

Here is my 'connect.php' document where it claims the error is:

<?php

$db = mysql_connect("localhost","root","NEWPASSWORD") or die("Could not connect to db");
if(!$db)
die("no db");
if(!mysql_select_db("tutorial",$db))
die("No Database Selected");

?>

Thanks for the help!
-62896dude
Languages: C++, C#, Javascript + Angular, PHP
Programs: Webstorm 2017, Notepad++, Photoshop
Current Project: HP Destiny
User avatar
PaxBritannia
Posts: 680
Joined: Sun Apr 18, 2010 1:54 pm

Re: Video #20

Post by PaxBritannia »

Hi 62896dude,

Welcome to indie-resource. Congratulations on your first post

The error is occurring because it couldn't connect to the database. Did you make sure your details here are correct?
Is your password really 'NEWPASSWORD'?

The connection details should be in the format ('Localhost', 'mysql_user', 'mysql_password').

Look forward to hearing form you.

pax.
User avatar
62896dude
Posts: 516
Joined: Thu Jan 20, 2011 2:39 am

Re: Video #20

Post by 62896dude »

umm how exactly do i figure out what those are? :p
Languages: C++, C#, Javascript + Angular, PHP
Programs: Webstorm 2017, Notepad++, Photoshop
Current Project: HP Destiny
User avatar
62896dude
Posts: 516
Joined: Thu Jan 20, 2011 2:39 am

Re: Video #20

Post by 62896dude »

Nevermind, I figured it out! I have lots of other errors, but i think i can figure those out on my own, but if i need help, i will post it here! :)
Languages: C++, C#, Javascript + Angular, PHP
Programs: Webstorm 2017, Notepad++, Photoshop
Current Project: HP Destiny
Post Reply

Return to “Older Browser MMO Videos”