List:General Discussion« Previous MessageNext Message »
From:Van Date:May 8 1999 11:54pm
Subject:PHP and mysql_result Need to reference the record I just inserted
View as plain text  
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);

Yields:
Warning: Variable $Result is not an array or string in
insertfeedback.php3 on line 16
--and--
CommentId=; Result=1 

Paul, Monty, Fred... someone not out enjoying their Saturday nite wanna
kick me in the a$$ with where I'm goofin'?
Regards,
Van
-- 
=========================================================================
Linux rocks!!!   www.dedserius.com
=========================================================================
Thread
How enable symlink-aware behavior?Scott Weikart3 Apr
  • How enable symlink-aware behavior?Michael Widenius3 Apr
  • PHP and mysql_result Need to reference the record I just insertedVan9 May
    • RE: PHP and mysql_result Need to reference the record I just insDon Read10 May
      • Re: PHP and mysql_result Need to reference the record I just insVan10 May