$query = "SELECT * FROM customers WHERE firstname = '$firstname', lastname = '$lastname'";
$result = mysql_query($query);
i keep getting Error: Query was empty
Use AND
OR
not comma. The logical operators available for MySQL are these: http://dev.mysql.com/doc/refman/5.0/en/logical-operators.html
So your query becomes:
$query = "SELECT * FROM customers WHERE firstname = '$firstname' AND lastname = '$lastname'";
It works! So i guess it is always better to use the "worded" versions of operations?
Yes, AND
is defined by the standard ANSI/SQL.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.