At 22:31 13.03.2003, Charles Kline said:
--------------------[snip]--------------------
>I am trying to get this sql query to work and am getting the error
>"Insufficient data supplied". Can anyone help with this?
>
>$sql = "SELECT id, concat(fname, ' ', lname, ' ', degree1) name
> FROM tbl_personnel "WHERE name LIKE \'%";
>$sql .= $attributes['nametofind'];
>$sql .= "%\' ORDER BY lname ASC";
>
>What I am trying to do is allow the user to find a personnel record
>that contains the name to find.
--------------------[snip]--------------------
At the first glance I see 3 items where the first one might be the culprit:
- if your query is exactly as you sent it here you're missing a comma after
the closing bracket of "concat()", just before "name"
- before constructing the query make sure $attributes['nametofind'] is
formatted correctly, esp. correctly escaping single quotes
- when using double quotes to construct a string you don't need to escape
single quotes.
--
>O Ernest E. Vogelsinger
(\) ICQ #13394035
^ http://www.vogelsinger.at/
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php