Jump to content

insert in mysql


chennaibala

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

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.