Problem with syntax :-

PHP Code:
$query = "SELECT * FROM BusNZ WHERE Unique=$matches[1]";

$result = mysql_query( $query)       or die( "Unable to view
database:<br>\n$query<hr>\n" .mysql_error());


Ive also tried (single quotes)

PHP Code:
$query = "SELECT * FROM BusNZ WHERE Unique='$matches[1]'";

$result = mysql_query( $query)       or die( "Unable to view
database:<br>\n$query<hr>\n" .mysql_error());

(you'll notice 3 ' on the end )

BOTH dont go - i get a message

Quote:
Has connected to database (databasename) Unable to add to database:
SELECT * FROM BusNZ WHERE Unique=2

You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use
near 'Unique=2' at line 1


Ps - $matches[1] - is the value 2.......

------

Ive looked on the web & found several tutorials on the select command
- However I  cant  see where I am going wrong.

PS the 'Unique' field is an 'auto-increment' field, & there IS a
record number 2 in the database/table.

-- 

G Stewart
NZ Bus Website update form
http://busnz.kwister.com/feedback.php


Community email addresses:
  Post message: [email protected]
  Subscribe:    [EMAIL PROTECTED]
  Unsubscribe:  [EMAIL PROTECTED]
  List owner:   [EMAIL PROTECTED]

Shortcut URL to this page:
  http://groups.yahoo.com/group/php-list 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/php-list/

<*> To unsubscribe from this group, send an email to:
    [EMAIL PROTECTED]

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/
 



Reply via email to