Jump to content

[SOLVED] Specific Record from DB


eits

Recommended Posts

Hi, I have a form which updates customer information and as default this gets started on record 1. I would like to be able to post a clientname from a previous form and then get the specific data for that customer.

 

I am fine with the posting to seperate pages stuff but how could I get the update form to start on this record?

 

I currently have:

$editFormAction = $_SERVER['PHP_SELF'];
if (isset($_SERVER['QUERY_STRING'])) {
  $editFormAction .= "?" . htmlentities($_SERVER['QUERY_STRING']);
}

if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) {
  $updateSQL = sprintf("UPDATE tblpotclients SET firstname=%s, surname=%s, company=%s, addline1=%s, addline2=%s, addline3=%s, postcode=%s, telephone=%s, category=%s, emailaddress=%s WHERE custid=%s",
                       GetSQLValueString($_POST['firstname'], "text"),
                       GetSQLValueString($_POST['surname'], "text"),
                       GetSQLValueString($_POST['company'], "text"),
                       GetSQLValueString($_POST['addline1'], "text"),
                       GetSQLValueString($_POST['addline2'], "text"),
                       GetSQLValueString($_POST['addline3'], "text"),
                       GetSQLValueString($_POST['postcode'], "text"),
                       GetSQLValueString($_POST['telephone'], "text"),
                       GetSQLValueString($_POST['category'], "text"),
                       GetSQLValueString($_POST['emailaddress'], "text"),
                       GetSQLValueString($_POST['custid'], "int"));

  mysql_select_db($database_BELdb, $BELdb);
  $Result1 = mysql_query($updateSQL, $BELdb) or die(mysql_error());
}

mysql_select_db($database_BELdb, $BELdb);
$query_rscustomers = "SELECT * FROM tblpotclients WHERE 'clientname'='FACELIFT'";
$rscustomers = mysql_query($query_rscustomers, $BELdb) or die(mysql_error());
$row_rscustomers = mysql_fetch_assoc($rscustomers);
$totalRows_rscustomers = mysql_num_rows($rscustomers);
?>

Link to comment
https://forums.phpfreaks.com/topic/68823-solved-specific-record-from-db/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.