Hy everyone!
I have a little problem about an uploading script, the problem is that i don't know how too add paths in mysql
this is the code for uploading script :
<?php
mysql_connect("localhost", "root", "") or die(mysql_error());
echo "Connected to MySQL<br />";
mysql_select_db('picap');
$path1= "apartamente/".$_FILES['ufile']['name'][0];
$path2= "apartamente/".$_FILES['ufile']['name'][1];
$path3= "apartamente/".$_FILES['ufile']['name'][2];
move_uploaded_file($_FILES['ufile']['tmp_name'][0], $path1);
move_uploaded_file($_FILES['ufile']['tmp_name'][1], $path2);
move_uploaded_file($_FILES['ufile']['tmp_name'][2], $path3);
$filesize1=$_FILES['ufile']['size'][0];
$filesize2=$_FILES['ufile']['size'][1];
$filesize3=$_FILES['ufile']['size'][2];
if($filesize1 && $filesize2 && $filesize3 != 0)
{
echo "We have recieved your files";
}
else {
echo "ERROR.....";
}
\
?>
in my database i have 3 fields named picture1 picture2 picture3 .. and they are varchar(255)
another thing that i want to do is to add this upload script in other script and the script is :
<a href="index.php">Back to List</a>
<?php
include("connect.php");
$tip = $_POST['tip'];
$nr_camere = $_POST['nr_camere'];
$zona = $_POST['zona'];
$adresa = $_POST['adresa'];
$confort = $_POST['confort'];
$etaj = $_POST['etaj'];
$suprtotala = $_POST['suprtotala'];
$suprutila = $_POST['suprutila'];
$an_constructie = $_POST['an_constructie'];
$vedere = $_POST['vedere'];
$orientare = $_POST['orientare'];
$nr_gr_sanitare = $_POST['nr_gr_sanitare'];
$nr_balcoane = $_POST['nr_balcoane'];
$bulina = $_POST['bulina'];
$cadastru_intabulare = $_POST['cadastru_intabulare'];
$descriere = $_POST['descriere'];
$pret = $_POST['pret'];
$query = "INSERT INTO apartamente (id, tip, nr_camere, zona, adresa, confort, etaj, suprtotala, suprutila, an_constructie, vedere, orientare, nr_gr_sanitare, nr_balcoane, bulina, cadastru_intabulare, descriere, pret)
VALUES ('', '$tip', '$nr_camere', '$zona', '$adresa', '$confort', '$etaj', '$suprtotala', '$suprutila', '$an_constructie', '$vedere', '$orientare', '$nr_gr_sanitare', '$nr_balcoane', '$bulina', '$cadastru_intabulare', '$descriere', '$pret')";
$results = mysql_query($query) or die
("Could not execute query : $query." . mysql_error());
if ($results)
{
echo "Details added.";
}
mysql_close();
?>
Thanks in advance, and sorry for my bad english