AW: [PHP] More: Frustrating ?
| From: | Martin Lucas | Date: | Mon, 18 Feb 2002 07:47:09 +0000 |
| Subject: | AW: [PHP] More: Frustrating ? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-85166@lists.php.net to get a copy of this message | ||
hi john,
maybe this is the right way
$where="id like ".$id;
$query="select * from ccl where '".$where."' order by AU desc";
$result=mysql_query($query);
regards
martin
> -----Ursprüngliche Nachricht-----
> Von: jtjohnston [mailto:taylorjo@collegesherbrooke.qc.ca]
> Gesendet: Montag, 18. Februar 2002 08:00
> An: php-general@lists.php.net
> Betreff: [PHP] More: Frustrating ?
>
>
> > > while ($mydata = mysql_fetch_object($news))
> > > So what am I doing wrong here:
> > > $where = "id like $id";
> > > $news = mysql_query('select * from ccl where '.$where.'
> order by AU desc');
> > //desc => z-a
>
> > A) Have you already confirmed that a valid database
> connection was made?
>
> Yes. A copy and paste of working code:
> $news = mysql_query("select * from ccl ORDER by AU asc");
> Connection was made.
>
> So I do?
>
> $news = mysql_query("select * from ccl where '.$where.' order
> by AU desc");
>
> or ?
>
> $news = mysql_query("select * from ccl where '.%$where%.'
> order by AU desc");
>
> The % are not necessary? because id is an auto_increment
> number from 0 to
> 1,000+.
>
> Why the ' inside " ?
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>