Jump to content

[SOLVED] Inserting Data


mike6256

Recommended Posts

Hi all

I am fairly new at php and need a little help.

I am having trouble with a code-it will insert my image but will not insert my number.

# Gather all required data

        $name = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['name']);

        $mime = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['type']);

        $size = $_FILES['uploaded_file']['size'];

        $data = mysqli_real_escape_string($dbLink, file_get_contents($_FILES  ['uploaded_file'][        'tmp_name']));

$number = mysqli_real_escape_string($dbLink, $_POST['textfield'], "text"),

 

The last line keeps kicking a pharse error

 

Thanks For Any Help

Link to comment
https://forums.phpfreaks.com/topic/146594-solved-inserting-data/
Share on other sites

probably because you are using a coma instead of a semi-colon, and you have too many parameters...

 

Try this:

        $name = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['name']);
        $mime = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['type']);
        $size = $_FILES['uploaded_file']['size'];
        $data = mysqli_real_escape_string($dbLink, file_get_contents($_FILES['uploaded_file']['tmp_name']));
        $number = mysqli_real_escape_string($dbLink, $_POST['textfield'] . "text");

updated the code with the ;  now is as follows

        # Gather all required data

        $name = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['name']);

        $mime = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['type']);

        $size = $_FILES['uploaded_file']['size'];

        $data = mysqli_real_escape_string($dbLink, file_get_contents($_FILES  ['uploaded_file'][        'tmp_name']));

$number = mysqli_real_escape_string($dbLink, $_POST['textfield'], ("text");

 

same thing--pharse error

updated the code with the ;   now is as follows

        # Gather all required data

        $name = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['name']);

        $mime = mysqli_real_escape_string($dbLink, $_FILES['uploaded_file']['type']);

        $size = $_FILES['uploaded_file']['size'];

        $data = mysqli_real_escape_string($dbLink, file_get_contents($_FILES  ['uploaded_file'][        'tmp_name']));

$number = mysqli_real_escape_string($dbLink, $_POST['textfield'], ("text");

 

same thing--pharse error

 

check my previous post, I concatenated some values... with the last line.

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.