PDA

View Full Version : Help with a newbie's PHP, please



quass@quass.com
12-05-2006, 05:20 PM
I'm just learning PHP and can't seem to determine why the following doesn't work. The message I get refers to "unexpected T_String".

Thanks.


<?php

$query = "SELECT * FROM Owl_Products LIMIT 0,30";
$result = mysql_query($query)
or die("Unable to select from Owl_Products");

SELECT MAX(Record_Number) AS maxno FROM Owl_Products;

while (Record_Number<=maxno) {

echo $result; }




mysql_close($db);
?>

Twey
12-05-2006, 06:06 PM
SELECT MAX(Record_Number) AS maxno FROM Owl_Products;That's an SQL statement, it shouldn't be in the middle of your PHP code.
while (Record_Number<=maxno) { All variable names in PHP must be prefixed with a dollar sign ($).