hi
I just subsribed to this list with the hope you can help me.
I am working on this code and I get a parse error in line 52 which is ...
I been going through it over and over and can't find a glue.
Has anyone out there a solution for me please?
I am a beginner in PHP and like to hear about anything I need to know.
Kindest Regards
Petra
[EMAIL PROTECTED]
<?
else:
// Connect to the database server
$dbcnx = @mysql_connect("localhost", "root", "");
if (!$dbcnx) {
echo( "<P>Unable to connect to the " .
"database server at this time.</P>" );
exit();
}
//Select the products database
if (! @mysql_select_db("JShistbau") ) {
echo ( "<P>Unable to locate the Product " .
"database at this time.</P>" );
exit();
}
// If a Product has been submitted,
// add it to the database.
if ("SUBMIT" == $submitproduct) {
$sql = "INSERT INTO JShistbau SET " .
"cdescription='$productdescription', " .
"cdateavailable=CURDATE()";
if (mysql_query($sql)) {
echo("<P>Your Product has been added.</P>");
} else {
echo("<P>Error adding submitted product: " .
mysql_error(). "</P>");
}
}
echo("<P> Here are all the products in our database: </P>:);
// Request the text of all the products
$result = mysql_query(
"select * from products"); !!!!!this is line 52!!!!!!
if (!$result) {
echo("<P>Error performing query: " .
mysql_error() . "</P>");
exit();
}
// Display the text of each product in a paragraph
while ( $row = mysql_fetch_array($result) ) {
echo("<P>" . $row["cdescription"] . "</P>");
}
//When clicked, this link will load this page
//with the product submission form displayed.
echo("<P><AHREF='$PHP_SELF?addproduct=1'>" .
"Add a Product!</A></P>");
end if;
?>
</BODY>
</HTML>
--
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]