I am using PHP 3.2.3, Mysql and Apache.
I am having a bad expirience trying to fill multiple html form objects with PHP. The query works - retreiving the query data works the first "select" dropdown works. Literally any Html/php form object after fails - giving errors or blank data return.
I am used to "Cold Fusion" and I think that I must be ignoring some simple rule of application here. Could someone assist me on this?
Thank you,
Gil
// --------------edit_quotes.php---------------------- :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/2000/REC-xhtml1-20000126/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Edit Quotes</title>
</head>
<body>
<?php
// ** edit_quote.php **
// Include the MySQL information:
require_once ("../db.php");
require_once ("../common.php");
// Create the query:
$query= "SELECT * FROM tblquotes ORDER BY quotes_id";
// Execute the query:
$query_result = mysql_query ($query);
// Retrieve and print the results just to make sure data is present:
while ($obj = mysql_fetch_object($query_result)) {
echo"[".$obj->quotes_id ."] ";
echo "$obj->quotes_author - ";
echo "$obj->quotes_quote ";
echo "<br>";
}
echo 'Edit this Quotation:<br />
<form action="6.php" method="post">
<ul>
<li>Quote ID: <select name="quotes_id">';
// Display the expense categories:
$query_result = mysql_query ('SELECT * FROM tblquotes ORDER BY quotes_id');
while($row=mysql_fetch_array($query_result, MYSQL_NUM)) {
echo"<option value=\"$row[0]\">$row[0]) $row[2] $row[1] </option>\n";
}
// the best I can do w this is get an empty text area:
New Quotation: <textarea name="quotes_quote" rows="5" cols="40">' . stripslashes($row[2]) . '</textarea> <p />
// I get a Parse error from the above text area:
@mysql_free_result($query_result);
mysql_close();
?>
// ------------------end------------------ :
</body>
</html>