[PHP-DB] PHP Beginners Help

2008-01-02 Thread Ben Stones
Hello, my name is Ben Stones. I am quite a beginner to PHP, and as a new years resolution I am going to learn PHP (finally!) Cut to the chase I have created a basic looping script that would display anything submitted in a form, on seperate lines; here is the PHP code: $con =

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

Re: [PHP-DB] Sum function for multiple recordsets?

2008-01-02 Thread Chris
[EMAIL PROTECTED] wrote: I'm getting a health insurance quote engine going... http://www.insuranceshoppers.net/getquotes/short-term-health.php ... it sends me an email with the info, and enters the info into a leads table in mysql. Then I want to have it show the rates (on a new page

Re: [PHP-DB] Querying Displaying a pricing table

2008-01-02 Thread Chris
Ron Piggott wrote: I am trying to query my rate_plan table and then display the results in a table format. I need help developing then SELECT syntax and how I am able to echo the results in a table. I want to display the results 7 columns, 4 rows. There are 7 tenures: I have rate plans set