0

Hi All,

Im getting and error from the following mysql statement when running it in the browser. Any help would be appreciated.

"you have an error in your sql syntax near -nextq accounts" on line 1"

this is the code

<?php $result = mysql_query("SELECT DISTINCT(source) FROM accounts WHERE source NOT IN ('')") or die(mysql_error());
        				    while($row = mysql_fetch_array($result)){ ?>
								 <option<?php if(!empty($_REQUEST['source']) && $_REQUEST['source']==$row['source']) echo " selected"; ?>><?=$row['source'];?>
								 <? } ?>
                                 <? $result = mysql_query("SELECT DISTINCT(original_source) FROM web146-nextq.accounts") or die(mysql_error());
        				    while($row = mysql_fetch_array($result)){ ?>
								 <option value="<? echo "3 Month Survey - " . $row['original_source'];?>"<? if(!empty($_REQUEST['source']) && $_REQUEST['source']== "3 Month Survey - " . $row['original_source']) echo " selected"; ?>>3 Month Survey - <?=$row['original_source'];?>

								 <? } ?>
                                 <? $result = mysql_query("SELECT DISTINCT(original_source) FROM web146-next6.accounts") or die(mysql_error());
2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by fobos
0

Instead of using $result multiple times, try using $result, $result2, $result and seee if that works

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.