flemingmike Posted December 12, 2010 Share Posted December 12, 2010 hello, anybody able to take a quick look and see why i have an error on both line 16 and 52? <?php include 'config.php'; include 'style.php'; include 'auth5.php'; $randeid=rand(121047, 997893); if(isset($_GET["delete"])) { $did=$_GET["delete"]; $query11= mysql_query("delete FROM tools where id =$did")or die(mysql_error()); } $groups = mysql_query("SELECT * FROM tools ORDER BY group"); $groups1=""; while($row1 = mysql_fetch_array($groups)) { $groupnames=$row1['group']; $groups1.="<OPTION VALUE=\"$groupnames\">".$groupnames.'</option>'; } ?> <form method="POST"> <p align="center">Search For: <select size="1" name="tool"><?php echo "$groups1"; ?></select> <input type="submit" value="Search" name="search"></p> </form> <?php if(isset($_POST['search'])) { $tool=$_POST['tool']; echo "<table border='1' style='border-collapse: collapse' bordercolorlight='#000000' bordercolordark='#000000' width='98%' align='center'>"; echo "<tr><td width='100%' colspan='4' align='center'><b>Tool List</b></td></tr>"; echo "<tr> <th align='center'>Tool</th> <th align='center'>Barcode</th> <th></th> <th></th> </tr>"; $result = mysql_query("SELECT * FROM tools WHERE group LIKE '%$tool%' ORDER BY tool"); while($row = mysql_fetch_array($result)) { $id=$row['id']; $tool=$row['tool']; $barcode=$row['barcode']; $location=$row['location']; echo "<tr>"; echo "<td align='center'>" . $tool . "</td>"; echo "<td align='center'><img src='barcode.php?format=jpeg&quality=100&width=150&height=75&barcode=" . $barcode . "'></td>"; echo "<td align='center'>Print</td>"; echo "<td align='center'><a href='searchtool.php?delete=" . $id . "'>Delete</a></td>"; echo "</tr>"; } echo "</table>"; } include 'close.php'; ?> Quote Link to comment https://forums.phpfreaks.com/topic/221368-error-on-line/ Share on other sites More sharing options...
PFMaBiSmAd Posted December 12, 2010 Share Posted December 12, 2010 Best guess is your queries are failing due to an error. If you echo mysql_error(); on the next line after the line with the mysql_query() statements, it will tell you why the query is failing. Quote Link to comment https://forums.phpfreaks.com/topic/221368-error-on-line/#findComment-1146054 Share on other sites More sharing options...
flemingmike Posted December 12, 2010 Author Share Posted December 12, 2010 Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in E:\Website\comco\searchtool.php on line 16 if i take away the ORDER BY group, no error on 16 Quote Link to comment https://forums.phpfreaks.com/topic/221368-error-on-line/#findComment-1146055 Share on other sites More sharing options...
flemingmike Posted December 12, 2010 Author Share Posted December 12, 2010 stupid thing.. it was because my field name was group Quote Link to comment https://forums.phpfreaks.com/topic/221368-error-on-line/#findComment-1146062 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.