ArizonaJohn Posted June 16, 2009 Share Posted June 16, 2009 Hello, I'm trying to use the code below to echo all tables in the database "feather" that have a row with $entry in the "site" column, and then what value each table has for the column "votes_up" for $entry. I'm getting an error for the line if(mysql_num_rows($resA) > 0) . The error says: Parse error: syntax error, unexpected ';'. Any ideas how I can fix it? Thanks in advance, John $result = mysql_query("SHOW TABLES FROM feather") or die(mysql_error()); while(list($table)= mysql_fetch_row($result)) { $sqlA = "SELECT `site`,votes_up FROM `$table` WHERE `site` LIKE '$entry'"; $resA = mysql_query($sqlA) or die("$sqlA:".mysql_error()); if(mysql_num_rows($resA) > 0) { $table_list[] = $table; while($rowA = mysql_fetch_assoc($resA)) { $votes_up[$rowA["site"]] = $rowA["votes_up"]; } } } foreach( $table_list as $key => $value){ echo "$value <br />"; } foreach($votes_up as $site => $vote_up) { echo "$site: $vote_up"; } Link to comment https://forums.phpfreaks.com/topic/162462-solved-parse-error-message/ Share on other sites More sharing options...
Cosizzle Posted June 16, 2009 Share Posted June 16, 2009 try if(mysql_num_rows($resA) == 0) Link to comment https://forums.phpfreaks.com/topic/162462-solved-parse-error-message/#findComment-857508 Share on other sites More sharing options...
wildteen88 Posted June 16, 2009 Share Posted June 16, 2009 I guess you have copied and pasted the code from somewhere. All instances of > need to be changed to '>' (without then quotes) > is invalid PHP syntax. Link to comment https://forums.phpfreaks.com/topic/162462-solved-parse-error-message/#findComment-857516 Share on other sites More sharing options...
ArizonaJohn Posted June 16, 2009 Author Share Posted June 16, 2009 OK, thanks. That helps. Link to comment https://forums.phpfreaks.com/topic/162462-solved-parse-error-message/#findComment-857520 Share on other sites More sharing options...
pkedpker Posted June 16, 2009 Share Posted June 16, 2009 doesnt mean he copied and pasted it.. just because it has > character entity I use all the time é in my html code because if you just put é (which means é) it will turn into a Box but otherwise it comes out as a nice é no idea why that happens but it must be a bug with Google Chrome. Link to comment https://forums.phpfreaks.com/topic/162462-solved-parse-error-message/#findComment-857525 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.