Jump to content

[SOLVED] Insert Into, Value


PHP Nubsauce

Recommended Posts

Can anybody tell me why my slideshowid isent pushing through right? It's sitting in the actual URL just fine.

 

$query = "INSERT INTO slideshow_images (max_image_name, max_image_size, max_image_type, max_image_content, request_id, side_caption, photo_caption, for_sale, approved, slideshow_id) ".

                "VALUES ('$thumbfileName', '$thumbfileSize', '$thumbfileType', '$thumbcontent', '$_POST[requestid]', '$_POST[sidecaption]', '$_POST[photocaption]', '$_POST[forsale]', 'no', '$_GET[slideshowid]')";

 

Any help would make me jump with joy.

 

Thanks,

 

Nubsauce.

 

Link to comment
Share on other sites

Try this for the values part:

"VALUES ('$thumbfileName', '$thumbfileSize', '$thumbfileType', '$thumbcontent', '$_POST[requestid]', '$_POST[sidecaption]', '".$_POST[photocaption]."', '$_POST[forsale]', 'no', '$_GET[slideshowid]')"; 

 

Link to comment
Share on other sites

you need to come out of your quotes when you want to insert $_POST and $_GET values directly. Or put them in brackets you should also use single quotes for the post and get values.

 

I put the values on seperate line to make sure the count was correct, you can return it to normal

$query = "INSERT INTO slideshow_images (max_image_name,
                                       max_image_size,
                                       max_image_type,
                                       max_image_content,
                                       request_id,
                                       side_caption,
                                       photo_caption,
                                       for_sale,
                                       approved,
                                       slideshow_id) ".
                "VALUES ('$thumbfileName',
                         '$thumbfileSize',
                         '$thumbfileType',
                         '$thumbcontent',
                         '".$_POST['requestid']."',
                         '".$_POST['sidecaption']."',
                         '".$_POST['photocaption']."',
                         '".$_POST['forsale']."',
                         'no',
                         '".$_GET['slideshowid']."')";

 

Ray

 

 

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.