Note that there are some explanatory texts on larger screens.

plurals
  1. POdisplay text with if/else statement if value not found in mysql table?
    text
    copied!<p>I'm trying to find a way of displaying an else or if statement in this code so that if the record/value doesn't exist in the mysql table then it will echo a piece of text like 'ask me'.</p> <p>heres the code:</p> <pre><code>&lt;?php $rates_set = get_rates(); while ($rates = mysql_fetch_array($rates_set)) { ?&gt; &lt;table width="110%" border="0" cellspacing="5" cellpadding="5"&gt; &lt;tr&gt; &lt;th align="left" valign="middle" bgcolor="#EBEBEB" scope="col"&gt;Rates&lt;/th&gt; &lt;th align="center" valign="middle" bgcolor="#EBEBEB" scope="col"&gt;money in&lt;/th&gt; &lt;th align="center" valign="middle" bgcolor="#EBEBEB" scope="col"&gt;money Out&lt;/th&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th align="left" valign="middle" bgcolor="#EBEBEB" scope="row"&gt;cost&lt;/th&gt; &lt;td align="center" valign="middle"&gt;£&lt;?php echo "{$rates['labour']} "; ?&gt;&lt;/td&gt; &lt;td align="center" valign="middle"&gt;£&lt;?php echo "{$rates['material']}"; ?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th align="left" valign="middle" bgcolor="#EBEBEB" scope="row"&gt;cost/th&gt; &lt;td align="center" valign="middle"&gt;£&lt;?php echo "{$rates['money']}"; ?&gt;&lt;/td&gt; &lt;td align="center" valign="middle"&gt;£&lt;?php echo "{$rates['expense']}"; ?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;tr&gt; &lt;th align="left" valign="middle" bgcolor="#EBEBEB" scope="row"&gt;Overnight&lt;/th&gt; &lt;td align="center" valign="middle"&gt;£&lt;?php echo "{$rates['charges']}"; ?&gt;&lt;/td&gt; &lt;td align="center" valign="middle"&gt;£&lt;?php echo "{$rates['fees']}"; ?&gt;&lt;/td&gt; &lt;/tr&gt; &lt;/table&gt; &lt;?php } ?&gt; </code></pre> <p>hope someone can help. thank you.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload