Jump to content

Recommended Posts

hi

am upload image by using below html tag

<input id="file1" type="text" value=0>

<input id="file1" type="file" name="file[]" >

<input id="file2" type="file" name="file[]" >

<input id="file3" type="file" name="file[]" >

<input type="submit" value="Send" />

<input id="file1" type="file" name="file[]" >

upload image show path like 

C:\Documents and Settings\My Documents\My Pictures\images0056.jpg

i need image name with extension like images0056.jpg etc from
file[] insert in database.

it must insert in these format

value              imagename
-------           -----------
0                     image0056.jpg
0                     image0057.jpg
0                     image0058.jpg

thanks in advance..







Link to comment
https://forums.phpfreaks.com/topic/181370-insert-in-mysql/
Share on other sites

 

hi frd

      here coding for u...by using these code i can insert only first image i.e image0056.jpg,other imagename not inserted.wht may be probem?thanks in advances...

 

    for($i=1; $i<=3; $i++)

      // $tmp_name= $_FILES["file"]["tmp_name"][$i];

        $no = 0;

        $picname = $_FILES["file"]["name"][$i];

// echo $name;

$sql1 = "INSERT INTO pictable(no, picname) VALUES('$no','$picname )";

mysql_query($sql1);

mysql_query("COMMIT");

mysql_close($con);

     

    }

Link to comment
https://forums.phpfreaks.com/topic/181370-insert-in-mysql/#findComment-960727
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.