This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2011-11-04 10:33:30

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

MySQL WHERE

I have code that works, but when I add the WHERE To = '$username' it doesn't work  sad


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#2 2011-11-04 10:38:19

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: MySQL WHERE

It says "mysql_num_rows or mysql_fetch_array(): supplied argument is not a valid MySQL result resource"


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#3 2011-11-04 11:21:46

LS97
Scratcher
Registered: 2009-06-14
Posts: 1000+

Re: MySQL WHERE

Then maybe the problem isn't with the command, but with the variable $username  wink
Check again.

Offline

 

#4 2011-11-04 12:46:23

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: MySQL WHERE

As I said in the other topic set the $username variable.  smile

Offline

 

#5 2011-11-04 13:45:28

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: MySQL WHERE

The username variable IS set. I even tried using WHERE To = 'Gopher' but still doesn't work  sad


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#6 2011-11-04 13:54:10

rookwood101
Scratcher
Registered: 2011-07-29
Posts: 500+

Re: MySQL WHERE

Code:

WHERE To='$username'

but make sure the whole thing is in "" (double quotes/speech marks)

Edit: Also the fact that the To column has a capital T might be doing it, unlikely but possible.

Last edited by rookwood101 (2011-11-04 13:55:26)


http://i.imgur.com/zeIZW.png

Offline

 

#7 2011-11-04 14:13:03

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: MySQL WHERE

still not working  sad


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#8 2011-11-04 15:00:19

Magnie
Scratcher
Registered: 2007-12-12
Posts: 1000+

Re: MySQL WHERE

Give us all the code, for the web page, remember to censor the passwords.  smile  ( I put my password into a config.php file so all I need to do is include it into the file and if I need help, it won't be showing in the document )

Edit: I feel so stupid, change "to" and "from" to something else like "receiver" and "sender" it didn't work for me with the "to" column but it did with "receiver"

Last edited by Magnie (2011-11-04 15:15:05)

Offline

 

#9 2011-11-04 15:19:42

WindowsExplorer
Scratcher
Registered: 2011-02-25
Posts: 1000+

Re: MySQL WHERE

Magnie wrote:

Give us all the code, for the web page, remember to censor the passwords.  smile  ( I put my password into a config.php file so all I need to do is include it into the file and if I need help, it won't be showing in the document )

Edit: I feel so stupid, change "to" and "from" to something else like "receiver" and "sender" it didn't work for me with the "to" column but it did with "receiver"

Well I'll be eaten - it worked! Thanks! This topic is closed!


http://i.imgur.com/H6LLdnK.pnghttp://i.imgur.com/VYuD7BY.png

Offline

 

#10 2011-11-04 15:28:44

Harakou
Community Moderator
Registered: 2009-10-11
Posts: 1000+

Re: MySQL WHERE

Closed by request of owner.


http://www.blocks.scratchr.org/API.php?action=random&return=image&link1=http://i.imgur.com/OZn2RD3.png&link2=http://i.imgur.com/duzaGTB.png&link3=http://i.imgur.com/CrDGvvZ.png&link4=http://i.imgur.com/POEpQyZ.png&link5=http://i.imgur.com/ZKJF8ac.png

Offline

 

Board footer