Jump to content

emclark

New Members
  • Posts

    3
  • Joined

  • Last visited

emclark's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Yes, Thank you. It's all good. No information is bad information. It all adds up. Better practices ahead. I understand that this is not the most secure version, but I am a noobie at PHP and this particular set of tutorials is very easy to understand, so it seemed like a good starting place. Places like PHP.net are (at this point) a bit hard for me to decipher. I have now solved this particular problem. Thank you all for the info.
  2. Thank you Jealous moderator. Thank you Jealous Moderator. the ISSET function was the problem.
  3. Hi PHP Freaks. Noobie here. Trying to learn PHP, following lecturesnippets.com PHP lessons. This is lesson 38. This seems like it should be simple, but no matter what I do, I can't get the database to update. Any help would be greatly appreciated. Thanks. Here's my code right now: <html> <head> </head> <body> <?php $con = mysqli_connect("localhost","Eric","******"); if (!$con){ die("Cannot connect:" . mysqli_connect_error()); } mysqli_select_db($con,"snippets"); if (isset($_POST['update'])){ $UpdateQuery = "UPDATE lectures SET Topic = '$_POST', Name='$_POST[name]', Attendance= '$_POST[attendance]' WHERE Topic='$_POST[hidden]'"; mysqli_query($con,$UpdateQuery); }; $sql = "SELECT * FROM lectures"; $myData = mysqli_query($con,$sql); echo "<table border=1> <tr> <th>Topic</th> <th>Name</th> <th>Attendance</th> </tr>"; while($record = mysqli_fetch_array($myData)){ echo"<form action=mydata3.php method=post>"; echo "<tr>"; echo "<td>" . "<input type=text name=topic value=" . $record['Topic'] . "> </td>"; echo "<td>" . "<input type=text name=name value=" . $record['Name'] . "> </td>"; echo "<td>" . "<input type=text name=attendance value=" . $record['Attendance'] . "> </td>"; echo "<td>" . "<input type=hidden name=hidden value=" . $record['Topic'] . "> </td>"; echo "<td>" . "<input type=submit name=submit value=update" . "> </td>"; echo "</form>"; } echo"</table>"; mysqli_close($con); ?> </body> </html>
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.