wenxi Posted June 10, 2007 Share Posted June 10, 2007 if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "retrieved")) { $updateSQL = sprintf("UPDATE user SET first_name=%s, last_name=%s, `add`=%s, `date_of_ birth`=%s, contact_mobile=%s, contact_home=%s, date_join=%s, date_left=%s, uc_id=%s, course_id=%s, password=%s WHERE user_id=%s", GetSQLValueString($_POST['tffirstname'], "text"), mysql_select_db($database_conn, $conn); $Result1 = mysql_query($updateSQL, $conn) or die(mysql_error()); } ============================================================= from my table - textfield <td><input name="tffirstname" type="text" id="tffirstname" value="<?php echo $first; ?>" /></td> is it the correct way? Quote Link to comment Share on other sites More sharing options...
wenxi Posted June 11, 2007 Author Share Posted June 11, 2007 can anyone help? Quote Link to comment Share on other sites More sharing options...
TEENFRONT Posted June 11, 2007 Share Posted June 11, 2007 you need to connect to the db before running a query..not after Quote Link to comment Share on other sites More sharing options...
btherl Posted June 11, 2007 Share Posted June 11, 2007 I don't see a call to mysql_connect(). Is that your entire script? Quote Link to comment Share on other sites More sharing options...
wenxi Posted June 11, 2007 Author Share Posted June 11, 2007 My codes are as attached [attachment deleted by admin] Quote Link to comment Share on other sites More sharing options...
lewis987 Posted June 11, 2007 Share Posted June 11, 2007 you have multiple connections to the mysql database, how about moving it to the top of the page ike this: <?php $mysqlHost="localhost"; $mysqlUsername="root"; $mysqlPassword=""; mysql_connect($mysqlHost,$mysqlUsername,$mysqlPassword) require_once('Connections/conn.php'); ?> <?php //initialize the session if (!isset($_SESSION)) { session_start(); }.......................... rather than the script connecting multiple times Quote Link to comment Share on other sites More sharing options...
wenxi Posted June 11, 2007 Author Share Posted June 11, 2007 okie already did what you said. wat is the method to update my database? It doesnt seems to work on my side still Quote Link to comment Share on other sites More sharing options...
wenxi Posted June 11, 2007 Author Share Posted June 11, 2007 please help.... Quote Link to comment Share on other sites More sharing options...
lewis987 Posted June 11, 2007 Share Posted June 11, 2007 how do you mean "update" as in instert a new row or update a previous row? Quote Link to comment Share on other sites More sharing options...
wenxi Posted June 11, 2007 Author Share Posted June 11, 2007 update the previous Quote Link to comment Share on other sites More sharing options...
lewis987 Posted June 11, 2007 Share Posted June 11, 2007 i guess you coded this software, i cant find a problem to be honest can you post your scripts? or email them to me on scoop_987@homtail.co.uk (add me on msn if needs be) Quote Link to comment Share on other sites More sharing options...
wenxi Posted June 11, 2007 Author Share Posted June 11, 2007 yes. emailed and added you on msn... Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.