bloom23
September 8th, 2008, 12:54 AM
Hey guys, I'm creating a basic CMS that will let me update items in my portfolio. Now, what I want to do is tag each record as web, interactive, or graphic so I can later display the record sets in different places.
Now I know the code to insert one record, but not 3. Here is what I have for one of them:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "folioUpdate")) {
$insertSQL = sprintf("INSERT INTO folio (project_title, project_descrip, project_img, featured) VALUES (%s, %s, %s, %s)",
GetSQLValueString($_POST['title'], "text"),
GetSQLValueString($_POST['descript'], "text"),
GetSQLValueString($_POST['image'], "text"),
GetSQLValueString(isset($_POST['featured']) ? "true" : "", "defined","'Y'","'N'"));
mysql_select_db($database_databaseName, $databaseName);
$Result1 = mysql_query($insertSQL, $databaseName) or die(mysql_error());Now I've been reading about this code here, will it work?
$Result1 = mysqli_multi_query($insertSQL, $databaseName) or die(mysql_error());So what I can't figure out (or find) is the sql and php code... My other tables look something like this:
tags
tag_id
tag_name
foliotags
proj_id
tag_id
If anyone could help me out here, I'd be forever in debt :P
Now I know the code to insert one record, but not 3. Here is what I have for one of them:
if ((isset($_POST["MM_insert"])) && ($_POST["MM_insert"] == "folioUpdate")) {
$insertSQL = sprintf("INSERT INTO folio (project_title, project_descrip, project_img, featured) VALUES (%s, %s, %s, %s)",
GetSQLValueString($_POST['title'], "text"),
GetSQLValueString($_POST['descript'], "text"),
GetSQLValueString($_POST['image'], "text"),
GetSQLValueString(isset($_POST['featured']) ? "true" : "", "defined","'Y'","'N'"));
mysql_select_db($database_databaseName, $databaseName);
$Result1 = mysql_query($insertSQL, $databaseName) or die(mysql_error());Now I've been reading about this code here, will it work?
$Result1 = mysqli_multi_query($insertSQL, $databaseName) or die(mysql_error());So what I can't figure out (or find) is the sql and php code... My other tables look something like this:
tags
tag_id
tag_name
foliotags
proj_id
tag_id
If anyone could help me out here, I'd be forever in debt :P