On 08-May-99 Van wrote:
> Okay, I'm beatin' myself up, and 4900 archived mysql messages later,
> still dying on the vine.
> Doing a feedback form in PHP. Works fine. Inserts the record. Code
> follows:
> $link = mysql_connect($dbhost, $dbuser, $dbpasswd);
> mysql_select_db($db,$link);
>
> $Result=mysql_query("INSERT INTO $dbtable VALUES ('', '$UserAgent',
> '$Referer',
> '$ScriptFilename', '$HitTime', '$RemoteHost', '$RemoteAddr',
> '$EmployeeRating', '$SafeComments','$FullName','$eMail')", $link);
>
> $CommentId=$Result[1];
> echo "<center>CommentId=$CommentId; Result=$Result";
> mysql_close($Result);
>
That works ??
as a C pgmr -> php newbie i get real shy about quoting in php; i always sprintf
the query, but if you say so ...
anyhow try:
if (mysql_query(INSERT INTO .... )) {
$CommentId=mysql_insert_id($link);
printf("<center>CommentId=%d Result=%d\n",$CommentId, $Result);
} else
echo "really bad vibes, dude ..";
http://www.php.net/manual/function.mysql-query.php3
http://www.php.net/manual/function.mysql-insert-id.php3
Regards,
---
Don Read sysop@stripped
EDP Manager dread@stripped
Calcasieu Lumber Austin Texas
- A baby is God's opinion that the world should go on.