View Full Version : PHP migration and database post

03-24-2010, 01:44 AM
I set up a simple page to display, edit and post data to a mysql db. It ran fine in php 4.9 but does not work in php 5.3. I can edit and display using php, I just can not get it to create a new row. I need 5.3 to run something else so downgrading is not an option. My System Config is :
Xampp 1.7.3
Apache 2.2.14
PHP 5.3.1, Default configs
MySQL 5.1.41

And the code less the connection is:

require 'connection2.php';

$Name = $_POST['Name'];
$Brew_Date = $_POST['Brew_Date'];
$Volume = $_POST['Volume'];
$Yeast = $_POST['Yeast'];
$Malts = $_POST['Malts'];
$OG = $_POST['OG'];
$FG = $_POST['FG'];
$Hops = $_POST['Hops'];
$IBU = $_POST['IBU'];
$B_Procedure = $_POST['B_Procedure'];
$F_Notes = $_POST['F_Notes'];
$B_Results = $_POST['B_Results'];
$ABV = $_POST['ABV'];
$Type = $_POST['Type'];

$update = "INSERT INTO redale (ID, Name, Brew_Date, Volume, Yeast, Malts, OG, FG, Hops, IBU, B_Procedure, F_Notes, B_Results, ABV, Type)
VALUES ('NULL', '$Name', '$Brew_Date', '$Volume', '$Yeast', '$Malts', '$OG', '$FG', '$Hops', '$IBU', '$B_Procedure', '$F_Notes', '$B_Results', '$ABV' , '$Type')" or die(mysql_error());

if($_POST['submit']) //If submit is hit

Header("Location: /site/beer/beer.php?refer=postsuccess");

03-24-2010, 02:27 AM
I'm an idiot I was opening with <? not <?php arg!