Easy for someone (not me) question
Posted: Thu Jan 01, 2009 8:51 am
Here's the code I'm having trouble with. I have a line in my MySQL database named Need_Help. It is set to return a 1 or a 0:
Need_Help tinyint(1) No 0
My problem is that the code is returning 'Need Help' regardless of the value of the Need_Help line in my database. Thanks in advance and Happy New Year!
if (mysql_num_rows($result) > 0) {
while($row = mysql_fetch_object($result)) {
if($row->Need_Help = 1) {
echo 'Need Help';
}
echo '<b><a href="' . $row->Web_Address . '">' . $row->Company_Name . '</a></b>
<br /> ';
echo $row->City . ',   ' . $row->State . ',   ' . $row->Country . '  
  ' ;
echo $row->Comment ;
echo '<br /><br /> ';
}
}
Need_Help tinyint(1) No 0
My problem is that the code is returning 'Need Help' regardless of the value of the Need_Help line in my database. Thanks in advance and Happy New Year!
if (mysql_num_rows($result) > 0) {
while($row = mysql_fetch_object($result)) {
if($row->Need_Help = 1) {
echo 'Need Help';
}
echo '<b><a href="' . $row->Web_Address . '">' . $row->Company_Name . '</a></b>
<br /> ';
echo $row->City . ',   ' . $row->State . ',   ' . $row->Country . '  
  ' ;
echo $row->Comment ;
echo '<br /><br /> ';
}
}