RE: Re[2]: Begining PHP...Have Questions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



But has that change (commas to periods) addressed the original problem you
posted regarding the code not returning the results you expect?

Rich


> -----Original Message-----
> From: Aaron Todd [mailto:aaloki88@xxxxxxxxxxx]
> Sent: Monday, July 19, 2004 3:14 PM
> To: php-db@xxxxxxxxxxxxx
> Subject: Re: Re[2]:  Begining PHP...Have Questions
> 
> 
> That explains it.  I did look at the manual and it did show . 
> instead of ,
> It just didnt even hit me.  One of those kick yourself mistakes.
> 
> Thanks,
> 
> Aaron
> 
> 
> "Pablo M. Rivas" <pmrivas01@xxxxxxxxxxxx> wrote in message
> news:7911410577.20040719155436@xxxxxxxxxxxxxxx
> > Hello Aaron,
> >
> >     why are you using , instead of . ?
> >
> >       $query = "SELECT * FROM users WHERE 
> email='",$_POST['username'],"'";
> >       is this a typo?...
> >       this sould be:
> >       $query = "SELECT * FROM users WHERE 
> email='".$_POST['username']."'";
> >       or $query = "SELECT * FROM users WHERE
> email='{$_POST['username']}'";
> >
> >       mhhh.. do you whant to know wy echo works and $query= not?
> >       read the manual... (string functions, echo) and (Language
> >       reference, String Operators)
> >
> >
> >       in echo case, you are giving more than 1 argument:
> >       echo "blahblablah",$variable,"blahblahblah";
> >       in $xx="blahblahblah",$variable,"blahblahblah" you 
> are getting a
> >       parse error.
> >
> >
> > AT> That makes great sence, however when I tried using 
> $_POST in my SQL
> > AT> statement it would not work.
> >
> > AT> This works fine:
> > AT> $query = "SELECT * FROM users WHERE email='".$username."'";
> > AT> But this one doesnt at all:
> > AT> $query = "SELECT * FROM users WHERE 
> email='",$_POST['username'],"'";
> >
> > AT> It does however work for  all the echo commands and It 
> is also correct
> when
> > AT> I echo the statement:
> > AT> echo "SELECT * FROM users WHERE email='",$_POST['username'],"'";
> >
> > AT> Am I missing something?
> >
> > AT> Thanks again,
> >
> > AT> Aaron
> >
> >
> >
> >
> > -- 
> > Best regards,
> >  Pablo
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 

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


[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux