I am displaying the results here... this is just a very rough implemtation
of what I want it to do ... my main issue was

with

$aSQL1 = "INSERT INTO table2 ( user_name, nameid) VALUES ( '$user',
LAST_INSERT_ID() )";

and the actual submitted value of $user that was being inputted into the DB.



the fetch statement is comming just didn't need it in there for this
example.

what I found interesting when i changed the name of $user to $uname in the
form and the db and script it worked as expected...

Cheers


-----Original Message-----
From: John Holmes [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, 14 May 2002 11:36 AM
To: 'Peter'; 'Php'
Subject: RE: [PHP] inputted value not being correctly ready by php


> $sql = "SELECT id, user_name, name FROM table1, table2, table3 WHERE
('id
> =
> table1.id') AND ('table1.userid = table2.id') AND ('table2.nameid =
> table3.id')";
> $result=mysql_query( $sql );
>
>
> echo ("your id is $id");
> echo ("<BR>");
> echo ("your name is $name");
> echo ("<BR>");
> echo ("your user name is<br> $user");

Remove those single quotes from your SELECT statement. Your WHERE
statement is just evaluating to 'string' AND 'string' AND 'string',
which will be true for every row in every table. It's no wonder you're
getting an odd result. Also, are you trying to display the values from
the database here? There is no fetch_* function to get anything out of
the result set. Where is $id coming from??

I can't explain result you're getting for $user, but with these errors,
I'm sure there are more, and there's no telling what's going on...

---John Holmes...


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to