php-db | 2001071
Date: 07/08/01
- Next message: Hugh Bothwell: "[PHP-DB] Re: Homesite Server Mapping"
- Previous message: Ken Sommers: "[PHP-DB] Homesite Server Mapping"
- In reply to: Brad Lipovsky: "[PHP-DB] A very simple MySQL + PHP error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
"Brad Lipovsky" <syzme <email protected>> wrote in message
news:20010708182828.84349.qmail <email protected>
> I get the following error:
>
> $Query = "SELECT * from $TableName WHERE title LIKE "%$title%")";
If you tried 'echo $Query' right here, you wouldn't see anything.
Try 'echo "305" % "300";'
You begin to see the problem, right? You used double quotes within your
string without escaping them (ie \") - so PHP treated it as the end of the
string. You would have gotten an error message, except that % is PHP's
modular division operator - so it tried to convert the strings to numbers
and do modular division on them.
How 'bout
$query = "SELECT * FROM $table WHERE title LIKE '%$title%' ";
-- PHP Database Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-db-unsubscribe <email protected> For additional commands, e-mail: php-db-help <email protected> To contact the list administrators, e-mail: php-list-admin <email protected>
- Next message: Hugh Bothwell: "[PHP-DB] Re: Homesite Server Mapping"
- Previous message: Ken Sommers: "[PHP-DB] Homesite Server Mapping"
- In reply to: Brad Lipovsky: "[PHP-DB] A very simple MySQL + PHP error"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]

