Forum Moderators: coopster

Message Too Old, No Replies

Only getting one return on an sql query

         

dorfmunder

9:00 pm on Jan 31, 2009 (gmt 0)

10+ Year Member



I'm sure this has been addressed many many times, but I can't seem to find the answer in a search here. My apologies.

Basic lowdown, I know that I have two records with "Chinese" in the cuisine field. Some have more than one type in the cuisine field, that is why I'm using LIKE. But I'm only getting one entry returned to me from my script.

I feel like a big dummy for even asking, and am sure this is just one tiny thing that needs to be changed. VERY new at this.

Here's that section of code:

$result = mysql_query("SELECT * FROM jeffcodiningcom_jeffcodining
WHERE cuisine LIKE '%Chinese%'") or die(mysql_error());

$row = mysql_fetch_array( $result );
echo $row['name']." <br> ".$row['phone'];

Thanks so much! :)

dorfmunder

9:11 pm on Jan 31, 2009 (gmt 0)

10+ Year Member



OK, figured out that "while" needs to be at the beginning, but am now getting yelled at about the ; after the closing ).

dorfmunder

9:44 pm on Jan 31, 2009 (gmt 0)

10+ Year Member



Got it! :D

coopster

7:23 pm on Feb 1, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Welcome to WebmasterWorld, dorfmunder.

A good text editor is going to come in handy for catching those syntax errors. Do a search over these forums and you'll find plenty of options.