> > if(! mysql_query('$sql'))

> Why the single quotes around $sql.  It's a string so you shouldn't have to
> quote it at all.

It's likely the single quotes that's causing the problems now.  Like perl,
single quotes in PHP are for 'absolute' strings, double quotes for
'interpreted' strings (strings that contain variable references, special
characters like \n etc).

By using single quotes you are passing the string '$sql' to the function.
Use double quotes, or better yet (as Paul suggested) remove the quotes
altogether to pass the _value of the $sql variable_ (i.e. your SQL query) to
the mysql_query function.

The rest looks good; except the lack of line breaks and indenting in your
code, but I tend to be anal about that sort of thing :)

- Darryl

  Darryl Friesen, B.Sc., Programmer/Analyst    [EMAIL PROTECTED]
  Education & Research Technology Services,     http://gollum.usask.ca/
  Department of Computing Services,
  University of Saskatchewan
  "Go not to the Elves for counsel, for they will say both no and yes"

PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to