What happened to the Messenger Plus! forums on msghelp.net?
Shoutbox » MsgHelp Archive » Skype & Technology » Tech Talk » MySql Code Help (PHP Database)

MySql Code Help (PHP Database)
Author: Message:
Ash_
Senior Member
****

Avatar

Posts: 638
Reputation: 31
35 / Male / –
Joined: Aug 2004
O.P. MySql Code Help (PHP Database)
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?

[Image: jeansiger5.jpg]
02-08-2005 06:22 AM
Profile PM Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
Joined: Mar 2004
RE: MySql Code Help (PHP Database)
*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
[Image: dt2.0v2.png]      Happy Birthday, WDZ
02-08-2005 06:42 AM
Profile PM Web Find Quote Report
Ash_
Senior Member
****

Avatar

Posts: 638
Reputation: 31
35 / Male / –
Joined: Aug 2004
O.P. RE: MySql Code Help (PHP Database)
i know that.

i just use the
code:
$result = mysql_query($query);


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

cheers anyway.

[Image: jeansiger5.jpg]
02-08-2005 07:01 AM
Profile PM Find Quote Report
Eljay
Elite Member
*****

Avatar
:O

Posts: 2949
Reputation: 77
– / Male / –
Joined: May 2004
RE: MySql Code Help (PHP Database)
posting the full script would help us to help you :)
02-08-2005 07:06 AM
Profile PM Find Quote Report
-dt-
Scripting Contest Winner
*****

Avatar
;o

Posts: 1819
Reputation: 74
36 / Male / Flag
Joined: Mar 2004
RE: MySql Code Help (PHP Database)
=/ 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
[Image: dt2.0v2.png]      Happy Birthday, WDZ
02-08-2005 07:08 AM
Profile PM Web Find Quote Report
Ash_
Senior Member
****

Avatar

Posts: 638
Reputation: 31
35 / Male / –
Joined: Aug 2004
O.P. RE: RE: MySql Code Help (PHP Database)
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.
[Image: jeansiger5.jpg]
02-08-2005 07:40 AM
Profile PM Find Quote Report
fluffy_lobster
Veteran Member
*****

Avatar
Posts: -2

Posts: 1391
Reputation: 23
36 / Male / Flag
Joined: Nov 2002
RE: MySql Code Help (PHP Database)
How about echo mysql_error(); straight after the query? :-/
02-08-2005 04:33 PM
Profile E-Mail PM Web Find Quote Report
« Next Oldest Return to Top Next Newest »


Threaded Mode | Linear Mode
View a Printable Version
Send this Thread to a Friend
Subscribe | Add to Favorites
Rate This Thread:

Forum Jump:

Forum Rules:
You cannot post new threads
You cannot post replies
You cannot post attachments
You can edit your posts
HTML is Off
myCode is On
Smilies are On
[img] Code is On