RE: [PHP] inputted value not being correctly ready by php
| From: | John Holmes | Date: | Tue, 14 May 2002 01:59:55 +0000 |
| Subject: | RE: [PHP] inputted value not being correctly ready by php | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-97456@lists.php.net to get a copy of this message | ||
Is register globals on in your PHP.ini? Are you sure there isn't a
cookie or session value of $user that's overwriting your POST value?
I really hope this is the case, it's such a perfect argument for why PHP
4.2 is the way it is... :)
---John Holmes...
> -----Original Message-----
> From: Peter [mailto:php@vfsa.com.au]
> Sent: Monday, May 13, 2002 9:47 PM
> To: 'Php'
> Subject: RE: [PHP] inputted value not being correctly ready by php
>
> 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:holmes072000@charter.net]
> 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