Jump to content

[SOLVED] INSERT INTO not working


nickelus

Recommended Posts

I'm going kooky trying to run this simple query it works manually in mysql but not through the php script sorry if this should be in php here's the code  (by the way i'm getting the initial vars echo'd on the form from another sheet that this file is included on & they are posting)

/*

if(isset($_POST['pusite'])&&($_POST['pusite']=="bill")){

$b_client_id=$_POST['bill_client_id'];

$b_company=$_POST['bill_company'];

$b_address1=$_POST['bill_address1'];

$b_address2=$_POST['bill_address2'];

$b_city=$_POST['bill_city'];

$b_state=$_POST['bill_state'];

$b_zip=$_POST['bill_zip'];

include "mydbconfig.php";

mysql_select_db($database);$billSQL=print_r("INSERT INTO client_pu_site (`client_id`, `company`, `address1`, `address2`, `city`, `state`, `zip`) VALUES ('$b_client_id', '$b_company', '$b_address1', '$b_address2', '$b_city', '$b_state', '$b_zip')");mysql_query($billSQL)or die("Blah!");

//i did this to make sure the vars were posting & they were

echo $b_client_id.$b_company.$b_address1.$b_address2.$b_city.$b_state.$b_zip;}

?>

<form action="<?php $_SERVER['PHP_SELF'];?>" method="POST" >

<table>

<input type="hidden" name="bill_company" value="<?php echo $company;?>" size="32" />

    <input type="hidden" name="bill_contact_name" value="<?php echo $contact_name;?>" size="32" />

    <input type="hidden" name="bill_address1" value="<?php echo $address1;?>" size="32" />

    <input type="hidden" name="bill_address2" value="<?php echo $address2;?>" size="32" />

    <input type="hidden" name="bill_city" value="<?php echo $city;?>" size="32" />

    <input type="hidden" name="bill_state" value="<?php echo $state;?>" size="32" />

    <input type="hidden" name="bill_zip" value="<?php echo $zip;?>" size="32" />

    <input type="hidden" name="bill_client_id" value="<?php echo $id;?>" size="32" />

    <input type="hidden" name="bill_phone" value="<?php echo $phone;?>" size="32" />

    <input type="hidden" name="pusite" value="bill"/>

    <tr valign="baseline">

            <td><input type="submit" value="Same As Billing" /></td>

    </tr>

</table>

</form>

*/

Link to comment
https://forums.phpfreaks.com/topic/166136-solved-insert-into-not-working/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.