Jump to content

Kamicase

Members
  • Posts

    7
  • Joined

  • Last visited

Posts posted by Kamicase

  1. @So Called: I did echo $write. That was in my response to Ings post but it didn't show anything weird. But thank you for reminding me to try the query window. There it has shown me, that I miswrote 'comment' where it should have been 'comments'. It's working great now. Thanks to all of you. : )

  2. @Mudsaf: Not sure anymore... I used to get some errors without it but I took it out to check which ones and it works just fine now. So I'll leave it without. The form looks like this:

    <form method="post" action="GreekSubmission.php">

    @So Called: Ah... Did I forget to actually say what went wrong? ^^ Well the mysql_query($write) OR DIE ('Error updating database') ends with the process dying and the error message being displayed. So the final step, the updating of the database, fails. @Ingolme: Very good idea. I did that and it gave me: "INSERT INTO table (name, lastname, color, comment) VALUES ('Dummyvalue', 'Testtext', 'Purple', 'I hope this works') so nothing out of place it seems. Is there something wrong with my syntax?

  3. Hello everyone, after getting some code on and my WAMP server revved up I am now trying to write the input from a form into a MySQL Database.The script I am using runs like this:

    	 <?php		  $alpha=""; $beta=""; $gamma=""; $theta="";		  if (isset($_POST['alpha'])) $alpha = $_POST['alpha'];		  if (isset($_POST['beta'])) $beta = $_POST['beta'];		  if (isset($_POST['gamma'])) $gamma = $_POST['gamma'];		  if (isset($_POST['theta'])) $theta = $_POST['theta']; 		mysql_connect("localhost","root"); // I'm running the Database local and for learning purposes.		mysql_select_db("database"); 			$write = "INSERT INTO table (name, lastname, color, comment)				VALUES ('$alpha', '$beta', '$gamma', '$theta')";			mysql_query($write) or die ('Error writing in database.');	?>

    When I run the script though (having entered some dummy information in all 4 fields)I had x OR DIE checks for both mysql_connect and mysql_select_db and they both confirmed that everything went fine so the bug must crawl through mysql_query($write) but I just can't seem to pin it down.Does anyone know where I might be wrong?

    • Like 1
×
×
  • Create New...