RE: problem....

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Haven't seen that this has been solved yet so I thought I'd throw my two
cents into the fray. First of all, I'd second the earlier suggestion that
you assign your query to a variable. And, second, I'd recommend that you
echo out your query to the browser just before it is submitted to the
database server. That way, you can actually _see_ what's being sent to the
server. I have found this to be an invaluable troubleshooting tactic and it
may help you find the root cause of your invalid MySQL result.


> -----Original Message-----
> From: David Robley [mailto:robleyd@xxxxxxxxxxxxxx]
> Sent: Wednesday, June 23, 2004 2:53 AM
> To: php-db@xxxxxxxxxxxxx
> Subject: Re:  problem....
> 
> 
> Water_foul wrote:
> 
> > i fixed those things and it didn't fix it :( :( :( :( :( :( 
> :( :( :( is
> > there a icq chatroom for php?)
> > "Shahmat Bin Dahlan" <shahmatd@xxxxxxxxxxxx> wrote in message
> > news:16780f91a.f91a16780@xxxxxxxxxxxxxxxxxxxxxxxxx
> >> Your SQL statement:
> >>
> >> 'SELECT     Rune, username FROM         RuneRunner
> >> RuneRunner_1 WHERE     (User_ID = 3)'
> >>
> >> What is "RuneRunner" and "RuneRunner_1"? Are these two 
> different tables.
> >> If it is, you might want to separate them with a comma.
> >>
> >> Why not try getting rid of the brackets surrounding 
> "User_ID=3"? And
> >> also wrap single quotes around the digit "3".
> >>
> >>
> >> ----- Original Message -----
> >> From: "water_foul" <phpdbnews@xxxxxxxxxxxxxxxxxxx>
> >> Date: Wednesday, June 23, 2004 8:58 am
> >> Subject: Re:  problem....
> >>
> >> > I checked em all they were right
> >> > "Daniel Clark" <dclark@xxxxxxxxxx> wrote in message
> >> > 
> news:18323.65.203.232.102.1087951969.squirrel@xxxxxxxxxxxxxxxxxxxxxxx
> >> > > Sounds like it doesn't like your SQL statement.  
> Perhaps a field
> >> > or table
> >> > > name is incorrect?
> >> > >
> >> > > > Warning: mysql_fetch_array(): supplied argument is 
> not a valid
> >> > MySQL> > result
> >> > > > resource in .......
> >> > > > "Daniel Clark" <dclark@xxxxxxxxxx> wrote in message
> >> > > >
> >> > 
> news:16692.65.203.232.102.1087950853.squirrel@xxxxxxxxxxxxxxxxxxxxxxx>
> >> >> What error are you getting?
> >> > > >>
> >> > > >> > why doesn't this work:
> >> > > >> > $pic=mysql_query('SELECT     Rune, username FROM
> >> > RuneRunner> >> > RuneRunner_1 WHERE     (User_ID = 
> 3)',$connection);
> >> > > >> > $pic=mysql_fetch_array($pic);
> >> >
> 
> Two suggestions for debugging mysql problems:
> 
> 1) Create your query as a variable so you can echo it and see 
> exactly what
> is being passed to mysql
> 
> $query = "SELECT Rune, username FROM RuneRunner, RuneRunner_1 
> WHERE User_ID
> = 3";
> 
> 2) Use mysql_error() to get the actual error from mysql
> $result = mysql_query($query,$connection);
> echo mysql_error();
> $pic=mysql_fetch_array($result);
> 
> -- 
> David Robley
> 
> "I'd like to learn a new card game," Tom said wistfully.
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux