SiMoZ Posted April 10, 2013 Share Posted April 10, 2013 (edited) Hey thanks for reading my thread, Currently im working on a Status Page for my Game Hacking Website. What i want todo is have a back Panel that i can Select "Game A" from a drop down box, and select the Detection status from another drop down box. Click the submit button, and it changes the values in the Database. I'm new to coding in PHP. <?PHP // Create connection $con=mysqli_connect("localhost","Username","Password","Database"); // Check connection if (mysqli_connect_errno($con)) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } $result = mysqli_query($con,"SELECT * FROM haxstatus"); $Hackname=""; $Status=""; $update=""; while($row = mysqli_fetch_array($result)) { $id=$row["Status"]; $name=$row["GameName"]; $Hackname.="<OPTION VALUE=\"$id\">".$name.'</option>'; } $list = mysqli_query($con,"SELECT * FROM haxstatus"); //dump the sql table in a table echo "<table border='1'> <tr> <th>Game Name:</th> <th>Detection Status:</th> </tr>"; while($row = mysqli_fetch_array($list)) { echo "<tr>"; echo "<td>" . $row['GameName'] . "</td>"; echo "<td>" . $row['Status'] . "</td>"; echo "</tr>"; } echo "</table>"; ?> <p> </p> <p> </p> <p> <SELECT NAME=name> <OPTION VALUE=0>Game Name <? echo $Hackname?> </SELECT> <SELECT Name="Detection"> <OPTION VALUE=0>Edit Detection Status <OPTION VALUE=1>Detected <OPTION VALUE=2>Undetected </SELECT> <form action="update.php" method="post"> <input type="submit"> </form> <?PHP $con=mysqli_connect("localhost","Username","Password","Database"); if (mysqli_connect_errno()) { echo "Failed to connect to MySQL: " . mysqli_connect_error(); } // i attempted to Update the table haxstatus and set Status to the drop down box named detection $sql="UPDATE haxstatus SET Status=$_POST[Detection] WHERE ('GameName')"; if (!mysqli_query($con,$sql)) { die('Error: ' . mysqli_error()); } echo "Updated"; mysqli_close($con); ?> When i click submit i get this error Warning: mysqli_error() expects exactly 1 parameter, 0 given in /home/gamead/public_html/update.php on line 15Error: Thank you in advanced if you choose to help. Edited April 10, 2013 by SiMoZ 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.