Jump to content

daedalous

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

daedalous's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Egads, a simple mistake indeed... Thanks so much for your help, and sorry to have wasted anyones time.
  2. SQL Server version: 5.0.51a Raw SQL, php var omitted: SELECT * FROM quote WHERE quote LIKE '%apple%' This code executes fine. 'quote' is the name of the table, in addition to being the name of a col in 'quote'. This really should be quite simple, and the above code executes without problem in phpmyAdmin, however, when used with this code: $result = mysql_query("SELECT * FROM quote WHERE quote LIKE '%$find%'"); if (@mysql_query($result)){ while($row = @mysql_fetch_array($result)){ echo $row['quote']; } It doesn't get past the if statement and gives me this: mySQL error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'Resource id #3' at line 1 I've echo'd the SQL query as a variable, with the php variable $find, and it prints correctly. It's a valid query. But I still get the syntax error above. Any ideas? Thanks in advance, Daed ps. I'm very new to php and mysql, my apologies if it's a simple mistake.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.