Jump to content

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

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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