hi there sammysweetheart,
Welcome to the forum!
Couple of issues.
firstly First Query:-
require_once('auth.php');
DATABASE INFO IS HERE....
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
$sql = "SELECT * FROM `".$tbl_name."` WHERE `member_id`= '".$member_id."' ";
$result = mysql_query($sql) or die(mysql_error());
Change the query to what I have quoted there, your vars needed concatenating properly, assuming that those vars come from the require_once file call..
Secondly I have rewritten this part correctly for you ;-p
For form processing, use the $_POST global to access the form submitted data.
if(isset($_POST['submit']) && ($_POST['submit'] == "submit")){
for($i=0;$i<$count;$i++){
$sql1 = "UPDATE `members` SET `firstname` = '".$firstname[$i]."', `middlename` = '".$middlename[$i]."', `lastname` = '".$lastname[$i]."', `street` = '".$street[$i]."', `street2` = '".$street2[$i]."', `city` = '".$city[$i]."', `state` = '".$state[$i]."', `zip` = '".$zip[$i]."', `country` = '".$country[$i]."', `primaryphone` = '".$primaryphone[$i]."', `otherphone` = '".$otherphone[$i]."', `fax` = '".$fax[$i]."', `email` = '".$email[$i]."', `login` = '".$login[$i]."', `emailopt` = '".$emailopt[$i]."', WHERE `member_id` = '".$member_id[$i]."' ";
$result1 = mysql_query($sql1) or die(mysql_error());
}
}
I have notice that all of the vars you have placed into the query are based on registered globals, which not all servers turn on in the ini file, you really had better access the global $_POST array by doing : $_POST['firstname'], etc, hopefully you can see what I mean there, but if your registered globals are set and the form is processed, that query might now work.
The form needs to be caught by the submit button, that's why I have done the isset() && clause.
Hopefully the form & post capture and update are all in the same file, as the action attribute in the <form> is not set, so by default it will post to itself (safer than $_SERVER['PHP_SELF'] anyway!)
Sorry if I have confused you at all there, I'm just trying to point out some good practise stuff there.
[EDIT] OOp's
Almost forgot to say (Apart from being quite tired and bleary eyed) when passing data from a form to mysql query, make sure that the data is cleaned/sanitised first, this will help prevent any malicious code injection to your site:-
mysql_real_escape_string(strip_tags($_POST['element_name_as _example']))
Just a pointer, check the functions out on php.net....
Cheers & good luck with the project,
MRb