Re: [PHP-DB] Problem with an update after an insert: MySQL

2005-02-07 Thread Bestman4unowwa
Bastien, Thanks for your help!. 
 
I think I found the answer to my problem. My system is a windows based  
system and it is not windows based. The system where the code doesn't work is  
Unix 
and is case sensitive. I went online to the mysql reference and found this  
link, _http://dev.mysql.com/doc/mysql/en/name-case-sensitivity.html_ 
(http://dev.mysql.com/doc/mysql/en/name-case-sensitivity.html) 


RE: [PHP-DB] Problem with an update after an insert: MySQL

2005-02-07 Thread Bastien Koert
Change yourr code to place the sql into a variable and the echo the variable 
out to see what the problem might be. You can also cut'n'paste the variable 
into the the mysql gui of your choice to see if there are other errors

Bastien
From: [EMAIL PROTECTED]
To: php-db@lists.php.net
Subject: [PHP-DB] Problem with an update after an insert: MySQL
Date: Mon, 7 Feb 2005 11:31:52 EST
I'm having trouble with having trouble with doing an update after doing an
insert on and a select on a table. The order of execution is:
 $result = mysql_query("select token from  tokenuserid where  userid =
'$none' ");
if (!$result)
echo  mysql_error();
  $numresult = mysql_num_rows($result);
$row =  mysql_fetch_row($result);
$gotToken =  $row[0];
$generatedToken =  date(YmdHis);
$result = mysql_query("insert into tokenuserid  values ('$generatedToken',
'$none')");
  $result = mysql_query("update tokenUserid set userid = '$userid'  where
token = '$gotToken'");
if (!$result)
echo  "can't find user";
I can't get this update to take. Actually, I can get this to work on one
implementation of this database and on the next implementation of this it
doesn't work. returning the error after the update. The MySQL version is  
3.23.52.
Is it because I have a capital U in the name tokenUserid in the update
statement? I could believe this as a reason since the table is defined as:
tokenuserid - (without any caps). If this is the problem then why does it 
occur  in one
implementation and not the other?
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php