Jump to content

Knowledge

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Everything posted by Knowledge

  1. Sir, you are correct. The script is now working. I want to thank you all for the help.
  2. Thank you for replying gentlemen. Both your replies fixed my error, small problem is I no longer get an error message, I just dont get a list of the names I have listed in my mysql database. Here is what I have updated it to. <?php $first_name = $_POST['firstname']; $last_name = $_POST['lastname']; require_once ('swdb_connect.php'); $query = "INSERT INTO description(firstname, lastname) VALUES ('$first_name', '$last_name')"; $result = mysql_query ($query); $query = "SELECT * FROM description"; $result = mysql_query ($query) or die('ERROR querying database.'); while($row = mysql_fetch_array($result)) { echo $row['firstame'] . '<br />'; } ?>
  3. Hello everyone! I am trying to pull from mysql a row of first names in a while loop but I keep getting the error message Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in line 52 The code is; <?php $first_name = $_POST['firstname']; $last_name = $_POST['lastname']; $full_name = $_POST['firstname'] . ' ' . $_POST['lastname']; require_once ('swdb_connect.php'); $query = "INSERT INTO description(firstname, lastname) VALUES ('$first_name', '$last_name')"; $result = @mysql_query ($query); while($row = mysqli_fetch_array($result)) { echo $row['firstame'] . '<br />'; ?> I don't understand why I get the error message, I have over 20 names in mysql If anyone can help that would be great
×
×
  • 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.