Page 9 of 13

Re: Video #20

Posted: Mon Nov 22, 2010 8:17 pm
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";

Re: Video #20

Posted: Tue Nov 23, 2010 3:03 am
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

Re: Video #20

Posted: Tue Nov 23, 2010 2:18 pm
by hallsofvallhalla
add some randid to them, you just have 0. they are there to instantiate between the two.

Re: Video #20

Posted: Tue Nov 23, 2010 8:43 pm
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?

Re: Video #20

Posted: Sun Nov 28, 2010 3:53 pm
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.

Re: Video #20

Posted: Sun Jan 09, 2011 8:59 pm
by Shihonoryu
You dont seem happy in this video :(

Re: Video #20

Posted: Thu Jan 20, 2011 2:44 am
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

Re: Video #20

Posted: Thu Jan 20, 2011 3:16 am
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.

Re: Video #20

Posted: Thu Jan 20, 2011 3:34 am
by 62896dude
umm how exactly do i figure out what those are? :p

Re: Video #20

Posted: Thu Jan 20, 2011 3:40 am
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! :)