Arr. i hoped there would be something like that. I am new to php and the book i have been trying to learn from recommended this:
Code:
$sql = "INSERT INTO $set_table SET " .
"refer_name='$refer_name', " .
"refer_email='$refer_email', " .
"refer_note='$note', " .
"name='$name[$count]', " .
"email='$email[$count]', " .
"clicked='N', " .
"reminders='0', " .
"last_email_date=CURDATE(), " .
"no_reminders='N', " .
"redirect_url='$redirect2', " .
"homepage='N', " .
"date=CURDATE()";
if (mysql_query($sql)) {
echo("<P>Your details have been added</P>");
} else {
echo("<P>Error adding details: " .
mysql_error() . "</P>");
}
which is a different format from your mysql_query statement. I like it in that you don't have to have the fields in order and can leave some out as well. How do i convert the $lastid into this format.
I tried with an intermediary like:
Code:
$inter = mysql_query($sql);
$lastid = mysql_insert_id($inter);
but that didn't work either, so i am stumped.
Thanks a lot for any help, i really appreciate it.
Bookmarks