Insert into DB
2 posts by 2 authors in: Forums > CMS Builder
Last Post: February 11, 2009 (RSS)
Are there any CMS Builder PHP functions available to insert rows into DB? I need the ability to add information to DB without having to use CMS Builder Admin/User GUI.
Re: [rwbuentello] Insert into DB
By Dave - February 11, 2009
Hi rwbuentello,
There's no CMS Builder functions for this, but if you're comfortable with PHP and MySQL the basic code looks like this:
I've also attached a sample addForm.php file that shows an example of a working form that inserts records and has basic data validation, etc.
Hope that helps!
There's no CMS Builder functions for this, but if you're comfortable with PHP and MySQL the basic code looks like this:
$query = "INSERT INTO cms_articles SET title='Hello', content='This is the content' ";
$result = mysql_query($query);
if (!$result) { die("MySQL Error: ". htmlspecialchars(mysql_error()) . "<br/>\n"); }
I've also attached a sample addForm.php file that shows an example of a working form that inserts records and has basic data validation, etc.
Hope that helps!
Dave Edis - Senior Developer
interactivetools.com
interactivetools.com