Jump to content

Question


PHP Newby

Recommended Posts

I'm a bit new to PHP and I have a question. It might be a little hard to answer but, here it is.



This is the snipet I'm having problems with:
[code]CODE
    $name  =  $_POST['name'];
    $price  =  $_POST['price'];
    $item  =  $_POST['item'];
    $date  =  $_POST['date'];
    $query = "INSERT INTO `secondlifetrans` ( `Name` , `Item` , `Price` , `Date` )
VALUES (
'$name', '$item', '$price', '$date'
);";[/code]
This, for some reason, outputs empty strings into the sql database, but I'm sure all the variables are completly defined. Any help, anyone?
Link to comment
Share on other sites

Comment out the SQL part and echo:
$name 
$price
$item
$date
to make sure you are actually getting the values from the previous script.


-------
Modify
-------

Not really sure that the semi-colon causes the problem. I know it isnt needed - but I didnt think it killed it either.
Link to comment
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.