Need help!!!

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Hi..

Anyone can help me with this script???I kept getting error saying i did not 
define the variable "$tutor_id" and whenever I define it as $tutor_id = $_POST
['tutor_id'], I got error saying there was an "Undefined index"!
What was exactly the problem??????
Need help desperately , greatly appreciate any suggestions/help/solutions 
given...

-------------------------------------------------------------------------------

=======edit.php======== 
         
$dsn = "mysql://root:**********@localhost/tb1"; 
$db = DB::connect ($dsn); 

   if (DB::isError ($db)) 
       die ($db->getMessage()); 

$action = $_GET["action"]; 

if($action == "delete") 
{ 
$sql = mysql_query ("DELETE FROM tutor WHERE tutor_id='$tutor_id'"); 
} 

if($action == "edit") 
{ 
$sql = mysql_query ("SELECT * FROM tutor WHERE tutor_id 
='$tutor_id'");**************ERROR HERE!!***************** 

$row = mysql_fetch_array($sql); 

echo "<form name=\"edit_tutor\" method=\"post\" action=\"edit2.php\">"; 
echo "Tutor ID : ".$row['tutor_id']."<br>"; 
echo "<input type=\"hidden\" name=\"tutor_id\" value=\"".$row 
['tutor_id']."\">"; 
echo "Name : <input name=\"tutor_name\" type=\"text\" value=\"".$row 
['tutor_name']."\"><br>"; 
echo "Contact No : <input type=\"text\" name=\"tutor_contact\" value=\"".$row 
['tutor_contact']."\"><br>"; 
echo "E-mail : <input type=\"text\" name=\"tutor_email\" value=\"".$row 
['tutor_email']."\"><br>"; 
echo "Profile : <input type=\"text\" name=\"tutor_profile\" value=\"".$row 
['tutor_profile']."\"><br>"; 
echo "<input type=\"submit\" name=\"Submit\" value=\"Update\">"; 
echo "</form>"; 

} 
?> 

$result = $db->query($sql); 

if( DB::isError($result) ) { 
    die ($result->getMessage()); 
} 
-------------------------------------------------------------------------------


Irin.

-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux