MmMMmm..... can't seem to get this to work. I have the following code which I have successfully connected to my SQL server database, and I have been reading data from it all night, but I can't seem to be able to use the INSERT query properly to add a new row into the database.
$query = "SELECT * FROM news";
$result = mysql_query($query);
while ($line = mysql_fetch_array($result, MYSQL_ASSOC))
{
print '<font face="Arial Rounded MT Bold">';
print $line["Subject"];
print '<br><small><small>Author: ';
print $line["Author"];
print ' on: ';
print $line["Date"];
print '</small><br><font face="Verdana">';
print $line["Content"];
print '</small><br><hr>';
}
/* Free resultset */
mysql_free_result($result);
$result = mysql_query("INSERT INTO news; VALUES ('Paul','paul', '2003-17-10', 'fred')") ;
mysql_free_result($result);
/* Closing connection */
mysql_close($link);
The code is practically straight from the examples in the PHP manual, except the insert statement near the bottom which I aded myself (which surprisingly does not work) but I cant figure out how.
Any help would be grand.
~ Paul