Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    PHP migration and database post

    Hi,
    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 :
    Vista
    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:

    PHP Code:
    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
    {
      
    $result=MYSQL_QUERY($update); 

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


  • #2
    New to the CF scene
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I'm an idiot I was opening with <? not <?php arg!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •