but the only data that will save at profile_photo is the user ID
i tried to code it but i didn't get the result that i want....
Code: Select all
<?php
$db_connect=mysql_connect("localhost","root","");
if(!$db_connect) {
die ("Could not connect: " . mysql_error());
}
mysql_select_db('my_db',$db_connect);
$Fname = $_POST['Fname'];
$Lname = $_POST['Lname'];
$MI = $_POST['MI'];
$Username = $_POST['Username'];
$Password = $_POST['Password'];
$Snumber = $_POST['Snumber'];
$Email = $_POST['Email'];
$Section = $_POST['Section'];
$sql1=("INSERT INTO all_users (id,Fname,Lname,MI,Username,Password,Snumber,Email,Section,User_type) VALUES
('','$Fname','$Lname','$MI','$Username','$Password','$Snumber','$Email','$Section','student')");
if (!mysql_query($sql1,$db_connect))
{
die('Error: ' . mysql_error());
}
echo "1 record added";
//i dont know if it correct
$sql = mysql_query("SELECT * FROM all_users");
while($info = mysql_fetch_array($sql)){
$id=$info['id'];
}
$sqlFORimage =("INSERT INTO profile_photo(id,filename,size,image_path) VALUES
('$id','','','')");
mysql_close($db_connect)
?>