Hello dears My respect for you all. i am totaly new to php i made this code to add data into a table named owner_property
I got this error
PHP Catchable fatal error: Object of class mysqli_result could not be converted to string in C:\inetpub\wwwroot\add_user_property.php on line 75
Can you guys help me <?php if (isset($_POST['submit'])) { /*$_If_Exist = mysqli_query($conn, "select PR_num from property where PR_num = '$_POST[PR_num]'"); if (mysqli_num_rows($_If_Exist) > 0) { die("<p class='red'>Sorry Unit # allready Exeist</p>"); } */ //Here the SQL Command to insert data in Property table $sql2 = "SELECT Owner_ID FROM owners WHERE name = $_POST[آName]"; $sql3 = "SELECT Pr_ID FROM property WHERE PR_num = $_POST[PR_num]"; $own = mysqli_query($conn , $sql2); $pro = mysqli_query($conn , $sql3); $sql= "INSERT INTO owner_property (Owner_ID, Pr_ID) VALUES ($own, $pro)"; if (!mysqli_query($conn, $sql)) { die("Faild:". mysqli_error($conn)); } echo "<p class='red'>Unit added to $_POST[name]</p>"; unset($_POST); } mysqli_close($conn);