Connecting Tech Pros Worldwide Forums | Help | Site Map

MySQL Query not working

behindspace
Guest
 
Posts: n/a
#1: Jul 17 '05
I'm all sorts of confused on this one...

// My Query:

$result = mysql_query("SELECT * FROM pricehistory WHERE partno partno =
\"".$part."\" ORDER BY partno ASC, year DESC, month DESC limit 1");

// My results:
$numrows = mysql_num_rows($result);

// The error that I'm getting:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result
resource in /***/***/***/***/***/***/searchHist2.php on line 28

Any guesses? I know I'm missing something, I just can't figure out what...


behindspace
Guest
 
Posts: n/a
#2: Jul 17 '05

re: MySQL Query not working


forget it, I figured it out.

$result = mysql_query("SELECT * FROM pricehistory WHERE partno =
'".$part."' ORDER BY partno ASC, year DESC, month DESC limit 1");

Closed Thread