darkfreaks Posted February 6, 2008 Share Posted February 6, 2008 ok so i have a compaint form and iti snot showing up any ideas ??? Code: <?php $strTitle = "Complaints/Reports"; define('QUADODO_IN_SYSTEM', true); require_once('includes/header2.php'); $qls->Security->check_auth_page('complaints.php'); echo "<h2>Complaints/Reports</h2> <form name=\"action\" id=\"action\" method=\"post\" action=\"commentsdelete.php\"> "; include ('config.php'); $query=trim(mysql_real_escape_string($query)); $query = "SELECT * FROM vc_comments WHERE username='admin' ORDER BY `id` DESC LIMIT 0,9"; $result = mysql_query($query); $num=mysql_num_rows($result) or die(mysql_error()); mysql_close(); $i=0; while ($i < $num) { $id = mysql_result($result,$i,"id"); $from = mysql_result($result,$i,"fname"); $date = mysql_result($result,$i,"date"); $message = mysql_result($result,$i,"message"); { echo "<table border=\"0\" width=\"100%\" cellpadding=\0\" cellspacing=\"0\" class=\"table\"> <tr> <td width=\"20\"><input type=\"checkbox\" id=\"$id\" value=\"$id\" name=\"$id\"></td> <td width=\"30%\" align=\"center\"> <a href=\"../profile/$from\">$from</a><br>$date<br> <a href=\"commentsadd.php?u=$from\">[ Reply ]</a> </td> <td width=\"70%\"> $message </td></tr></table> <p>"; }; $i++; } echo "<input type=\"submit\" name=\"delete\" id=\"delete\" value=\"Delete Comments\"> </form>"; include ('includes/footer.php'); ?> Quote Link to comment Share on other sites More sharing options...
teng84 Posted February 6, 2008 Share Posted February 6, 2008 <?php $strTitle = "Complaints/Reports"; define('QUADODO_IN_SYSTEM', true); require_once('includes/header2.php'); $qls->Security->check_auth_page('complaints.php'); echo "<h2>Complaints/Reports</h2> <form name=\"action\" id=\"action\" method=\"post\" action=\"commentsdelete.php\"> "; include ('config.php'); $query=trim(mysql_real_escape_string($query)); $query = "SELECT * FROM vc_comments WHERE username='admin' ORDER BY `id` DESC LIMIT 0,9"; $result = mysql_query($query); $num=mysql_num_rows($result) or die(mysql_error()); mysql_close(); $i=0; while ($i < $num) { $id = mysql_result($result,$i,"id"); $from = mysql_result($result,$i,"fname"); $date = mysql_result($result,$i,"date"); $message = mysql_result($result,$i,"message"); {///////<-----------------------------------------------------------------------------------what is that echo "<table border=\"0\" width=\"100%\" cellpadding=\0\" cellspacing=\"0\" class=\"table\"> <tr> <td width=\"20\"><input type=\"checkbox\" id=\"$id\" value=\"$id\" name=\"$id\"></td> <td width=\"30%\" align=\"center\"> <a href=\"../profile/$from\">$from</a><br>$date<br> <a href=\"commentsadd.php?u=$from\">[ Reply ]</a> </td> <td width=\"70%\"> $message </td></tr></table> <p>"; };//----------------------------------------------------------------what is this? $i++; } echo "<input type=\"submit\" name=\"delete\" id=\"delete\" value=\"Delete Comments\"> </form>"; include ('includes/footer.php'); ?> see the comments Quote Link to comment Share on other sites More sharing options...
phorcon3 Posted February 6, 2008 Share Posted February 6, 2008 <?php $strTitle = "Complaints/Reports"; define('QUADODO_IN_SYSTEM', true); require_once 'includes/header2.php'; $qls->Security->check_auth_page('complaints.php'); echo '<h2>Complaints/Reports</h2><form name="action" id="action" method="post" action="/commentsdelete.php">'; include 'config.php'; $total_a = mysql_query("SELECT Count(*) AS Count FROM `vc_comments` WHERE `username` = 'admin'"); $total_b = mysql_result($total_a, 0, 0); if(!empty($total_b)) { $a = mysql_query("SELECT * FROM `vc_comments` WHERE `username` = 'admin' ORDER BY `id` DESC LIMIT 0,9"); while($b = mysql_fetch_assoc($a)) { echo '<table border="0" width="100%" cellpadding="0" cellspacing="0" class="table"> <tr> <td width="20"><input type="checkbox" id="'.$b['id'].'" value="'.$b['id'].'" name="id[]"></td> <td width="30%" align="center"> <a href="../profile/'.$b['fname'].'">'.$b['fname'].'</a><br>'.$b['date'].'<br> <a href="/commentsadd.php?u='.$b['fname'].'">[ Reply ]</a> </td> <td width="70%">'.$b['message'].'</td> </tr> </table>'; } } echo '<input type="submit" name="delete" id="delete" value="Delete Comments"></form>'; include 'includes/footer.php'; ?> thats how id do it.. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 6, 2008 Author Share Posted February 6, 2008 the form does not show butthedelete button does ??? Quote Link to comment Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 Are you sure $num isn't an empty value? If it is, none of the form fields would display. Quote Link to comment Share on other sites More sharing options...
phorcon3 Posted February 6, 2008 Share Posted February 6, 2008 just ..in case someone reads what i wrote lol .. i got the <?php if(!empty($total_b)) ?> screwed up, it should be <?php if($total_b != 0) ?> or <?php if(!$total_b) ?> whatever is better ..dunno lol Quote Link to comment Share on other sites More sharing options...
teng84 Posted February 6, 2008 Share Posted February 6, 2008 <?php $strTitle = "Complaints/Reports"; define('QUADODO_IN_SYSTEM', true); require_once('includes/header2.php'); $qls->Security->check_auth_page('complaints.php'); echo "<h2>Complaints/Reports</h2> <form name=\"action\" id=\"action\" method=\"post\" action=\"commentsdelete.php\"> "; include ('config.php'); $query=trim(mysql_real_escape_string($query)); $query = "SELECT * FROM vc_comments WHERE username='admin' ORDER BY `id` DESC LIMIT 0,9"; $result = mysql_query($query); if(mysql_num_rows($result)>0){ echo "<table border=\"0\" width=\"100%\" cellpadding=\0\" cellspacing=\"0\" class=\"table\"> <tr>"; while($row = mysql_fetch_array($result)){ $id =$row["id"]; $from = $row["fname"]; $date = $row["date"]; $message = $row["message"]; echo "<td width=\"20\"><input type=\"checkbox\" id=\"$id\" value=\"$id\" name=\"$id\"></td> <td width=\"30%\" align=\"center\"> <a href=\"../profile/$from\">$from</a><br>$date<br> <a href=\"commentsadd.php?u=$from\">[ Reply ]</a> </td> <td width=\"70%\"> $message </td></tr>"; echo "</table>"; } } echo "<p><input type=\"submit\" name=\"delete\" id=\"delete\" value=\"Delete Comments\"></form>"; include ('includes/footer.php'); ?> try Quote Link to comment Share on other sites More sharing options...
kankaro Posted February 6, 2008 Share Posted February 6, 2008 when you code arrange it properly Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 6, 2008 Author Share Posted February 6, 2008 nope Quote Link to comment Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 'Nope' what? Who are you saying that to? Whats it in reference to? Did you check if $num is receiving anything from the database? Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 6, 2008 Author Share Posted February 6, 2008 its not empty no it queries ??? Quote Link to comment Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 So what is it equal to when you output it? Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 6, 2008 Author Share Posted February 6, 2008 num is equal to 6 Quote Link to comment Share on other sites More sharing options...
phorcon3 Posted February 6, 2008 Share Posted February 6, 2008 <?php $strTitle = "Complaints/Reports"; define('QUADODO_IN_SYSTEM', true); require_once('includes/header2.php'); $qls->Security->check_auth_page('complaints.php'); echo "<h2>Complaints/Reports</h2> <form name=\"action\" id=\"action\" method=\"post\" action=\"commentsdelete.php\"> "; include ('config.php'); $query=trim(mysql_real_escape_string($query)); $query = "SELECT * FROM vc_comments WHERE username='admin' ORDER BY `id` DESC LIMIT 0,9"; $result = mysql_query($query); $num=mysql_num_rows($result) or die(mysql_error()); mysql_close(); $i=0; while ($i < $num) { $id = mysql_result($result,$i,"id"); $from = mysql_result($result,$i,"fname"); $date = mysql_result($result,$i,"date"); $message = mysql_result($result,$i,"message"); echo "<table border=\"0\" width=\"100%\" cellpadding=\0\" cellspacing=\"0\" class=\"table\"> <tr> <td width=\"20\"><input type=\"checkbox\" id=\"$id\" value=\"$id\" name=\"$id\"></td> <td width=\"30%\" align=\"center\"> <a href=\"../profile/$from\">$from</a><br>$date<br> <a href=\"commentsadd.php?u=$from\">[ Reply ]</a> </td> <td width=\"70%\"> $message </td></tr></table> <p>"; $i++; } echo "<input type=\"submit\" name=\"delete\" id=\"delete\" value=\"Delete Comments\"> </form>"; include ('includes/footer.php'); ?> that is NOT workin? Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 6, 2008 Author Share Posted February 6, 2008 nope Quote Link to comment Share on other sites More sharing options...
phorcon3 Posted February 6, 2008 Share Posted February 6, 2008 lol ok ..just checkin.. ^^ Quote Link to comment Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 I think your problem may be here: echo '<h2>Complaints/Reports</h2><form name="action" id="action" method="post" action="/commentsdelete.php">'; you are missing backslashes before mosto f your quotes. It should read: echo '<h2>Complaints/Reports</h2><form name=\"action\" id=\"action\" method=\"post\" action=\"/commentsdelete.php\">'; Quote Link to comment Share on other sites More sharing options...
Stooney Posted February 6, 2008 Share Posted February 6, 2008 Actually the double quotes don't need to be escaped if echo is using single quotes. This is fine echo '<h2>Complaints/Reports</h2><form name="action" id="action" method="post" action="/commentsdelete.php">'; Quote Link to comment Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 Thats true. I don't use single quotes, so I wasn't thinking about that. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 6, 2008 Author Share Posted February 6, 2008 wrong wrong and wrong it is still not working Quote Link to comment Share on other sites More sharing options...
Stooney Posted February 6, 2008 Share Posted February 6, 2008 Tell us what's not working. What's expected? Give us some details. wrong wrong and wrong it is still not working What are we supposed to do with that? Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 6, 2008 Author Share Posted February 6, 2008 it didnt echo anything at ALL. regardless if i used single or double quotes Quote Link to comment Share on other sites More sharing options...
hamza Posted February 6, 2008 Share Posted February 6, 2008 Dear , Some times mysql_num_rows getting error remove the mysql num and give some values to it and try to show your button. or go to php.net for the further help Quote Link to comment Share on other sites More sharing options...
haku Posted February 6, 2008 Share Posted February 6, 2008 I just realized there is an extra set of curly braces ({}) around the echo statement. I think it is being skipped as a result. Remove those curly braces and your script should (may?) work. Quote Link to comment Share on other sites More sharing options...
darkfreaks Posted February 8, 2008 Author Share Posted February 8, 2008 those curly braces are needed because it is an else statement any oter ideas ??? ??? Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.