RE: [PHP-DB] PHP Beginners Help

2008-01-02 Thread Bastien Koert
Hi ben, You are creating the same table each time you run the code which would throw an error the second time you run the code since the table is already there. You have two choices here: 1. remove the table creation script and the call to create it since the table only needs to be created

Re: [PHP-DB] PHP Beginners Help

2008-01-02 Thread Benjamin Darwin
Ben: First, using a $_POST value directly into a MySQL query is EXTREMELY unsafe. Always filter data from any source to make sure it's what you expect. SQL injection is one of the easiest ways to cause real damage to a website. http://en.wikipedia.org/wiki/SQL_injection Check out this fuction

Re: [PHP-DB] PHP Beginners Help

2008-01-02 Thread Ben Stones
Thanks all for your replies. Much appreciated. I have edited the code and took points into account: $con = mysql_connect(localhost,ben_test,removed) or die(con); $db = mysql_select_db(ben_test) or die(db); $sql1 = mysql_query(INSERT INTO `comments` (`messages`) VALUES ($comments)) or

Re: [PHP-DB] PHP Beginners Help

2008-01-02 Thread Chris
Ben Stones wrote: Thanks all for your replies. Much appreciated. I have edited the code and took points into account: $con = mysql_connect(localhost,ben_test,removed) or die(con); $db = mysql_select_db(ben_test) or die(db); $sql1 = mysql_query(INSERT INTO `comments` (`messages`) VALUES