Shoutbox

MySql Code Help (PHP Database) - Printable Version

-Shoutbox (https://shoutbox.menthix.net)
+-- Forum: MsgHelp Archive (/forumdisplay.php?fid=58)
+--- Forum: Skype & Technology (/forumdisplay.php?fid=9)
+---- Forum: Tech Talk (/forumdisplay.php?fid=17)
+----- Thread: MySql Code Help (PHP Database) (/showthread.php?tid=38063)

MySql Code Help (PHP Database) by Ash_ on 02-08-2005 at 06:22 AM

pfft, MySql is evil, satins preferred language.

anyway.

code:
$database = 'rcbb';
$table = 'post';
$usernametable= 'users';
$query="SELECT * FROM `$usernametable` WHERE `username` = '$Username' ";



^^ this code doesnt work.

quote:
Originally posted by PHP Error


Warning: mysql_result(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp1-7\www\create.php on line 23

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp1-7\www\create.php on line 24

Warning: mysql_result(): supplied argument is not a valid MySQL result resource in c:\program files\easyphp1-7\www\create.php on line 25


but...

code:
$query="SELECT * FROM `$table` WHERE `id` = '$ThreadID' ";


works in a different script, username and password is pre-varibilised.

if you need more information ill post it.

does anyone know why?


RE: MySql Code Help (PHP Database) by -dt- on 02-08-2005 at 06:42 AM

*this is going to be hard to write scince my dog is sitting on my keyboard

can u post your code where u connect to the db and select it , send data to it and stuff
because

code:

$database = 'rcbb';
$table = 'post';
$usernametable= 'users';
$query="SELECT * FROM `$usernametable` WHERE `username` = '$Username' ";


does nothing cept set variables  :P

blahh get on msn and ill kick the dog off my keyboard and help you more
RE: MySql Code Help (PHP Database) by Ash_ on 02-08-2005 at 07:01 AM

i know that.

i just use the

code:
$result = mysql_query($query);


btw i cant come on msn until 8:30pm.

cheers anyway.


RE: MySql Code Help (PHP Database) by Eljay on 02-08-2005 at 07:06 AM

posting the full script would help us to help you :)


RE: MySql Code Help (PHP Database) by -dt- on 02-08-2005 at 07:08 AM

=/ have u even connected to your database lol
Using something like

code:
$sql = mysql_connect($loc,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");


=/ and why cant u come on your on the forums lol or is it the "sharing" thing?

:P just post all your code lol or pm it to me
RE: RE: MySql Code Help (PHP Database) by Ash_ on 02-08-2005 at 07:40 AM

quote:
Originally posted by -dt-
=/ have u even connected to your database lol
Using something like
code:
$sql = mysql_connect($loc,$username,$password);
@mysql_select_db($database) or die( "Unable to select database");


=/ and why cant u come on your on the forums lol or is it the "sharing" thing?

:P just post all your code lol or pm it to me


pfft, didnt i say the second one worked?

im not that stupid you know. :P

btw, im not gonna post whole script, she's my precious.
RE: MySql Code Help (PHP Database) by fluffy_lobster on 02-08-2005 at 04:33 PM

How about echo mysql_error(); straight after the query? :-/