Note that there are some explanatory texts on larger screens.

plurals
  1. POHTML and PHP Embedding
    primarykey
    data
    text
    <p>here am trying to fetch data from a mysql table and populate it in a html. Everything works fine But I want to echo a html button through a IF condition. I dont know if this could work..if it works...can anyone please tell me how to make it work ?. The error am getting is...INTERNAL SERVER ERROR :(</p> <p>NOTE : I have commeted the exact place where i have problem</p> <pre><code>&lt;?php if(mysql_num_rows($sql)){ while($rs = mysql_fetch_object($sql)) { ?&gt; &lt;tr&gt; &lt;td align="center"&gt;&lt;?php echo $rs-&gt;cnf_name ;?&gt;&lt;/td&gt; &lt;td align="center"&gt;&lt;?php echo $rs-&gt;address;?&gt;&lt;/td&gt; &lt;td align="center"&gt;&lt;?php echo $rs-&gt;added_on;?&gt;&lt;/td&gt; &lt;td align="center"&gt;&lt;input type="button" class="btn" value="Edit" onClick="window.parent.editCnf('&lt;?php echo $rs-&gt;cnf_name;?&gt;','&lt;?php echo $rs-&gt;username ;?&gt;','&lt;?php echo $rs-&gt;password;?&gt;','&lt;?php $rs-&gt;type;?&gt;','&lt;?php echo $rs-&gt;person_name;?&gt;','&lt;?php echo $rs-&gt;address;?&gt;','&lt;?php echo $rs-&gt;mobile_no?&gt;','&lt;?php echo $rs-&gt;email;?&gt;','&lt;?php echo $rs-&gt;country;?&gt;','&lt;?php echo $rs-&gt;city;?&gt;','&lt;?php echo $rs-&gt;state;?&gt;','&lt;?php echo $rs-&gt;area;?&gt;')" &gt;&lt;/td&gt; //PROBLEM &lt;td align="center"&gt; &lt;?php if($rs-&gt;cnf_status == 0) { echo "&lt;input type="button" class="btn" id="status" value="Activate" onClick="window.parent.deleteCnf(&lt;?php echo $rs-&gt;user_id;?&gt;,&lt;?php echo $rs-&gt;cnf_status; ?&gt;);"&gt;"; } else { echo "&lt;input type="button" class="btn" id="status" value="Activate" onClick="window.parent.deleteCnf(&lt;?php echo $rs-&gt;user_id;?&gt;,&lt;?php echo $rs-&gt;cnf_status; ?&gt;);"&gt;"; } ?&gt; &lt;/td&gt; &lt;/tr&gt; &lt;?php } } else { ?&gt; &lt;tr&gt; &lt;td colspan=""&gt;No data to display&lt;/td&gt; &lt;/tr&gt; &lt;?php } ?&gt; &lt;/tbody&gt; &lt;/table&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

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