Greetings, experts!
I'm having trouble coding PHP to UPDATE an image filename to a lookup table within my sandv_update.php page.
I have three tables within my database:
Table: sandf
sandf_id (primary key)
other fields that pertain to sandv.php
Table: categories
cat_id (primary key)
category
Table: image_cat_lookup
image_id (primary key)
cat_id (primary key)
#1: sandv.php needs to have four images displayed on this page all at once. I know how to get ONE image from my database, but not four--I was highly recommended to create a lookup table. Unfortunately, I am lost when it comes to trying to program PHP to UPDATE to my lookup table. I want to allow the user to choose multiple filenames (the list box is allready set up). I understand the point of a lookup table, but don't know how to implement the code.
Currently, this is what my code looks like:
Code:if ((isset($_POST["MM_update"])) && ($_POST["MM_update"] == "form1")) { $updateSQL = sprintf("UPDATE sandf SET colt_start_desc=%s, mounted_desc=%s, follow_up_desc=%s, refinement_desc=%s, restarting_desc=%s, priv_sess_ranch=%s, priv_sess_facility=%s, group_lessons=%s, discount_coupons=%s, sess_desc=%s, sandf_facility=%s, images_id=%s WHERE sandf_id=%s", GetSQLValueString($_POST['colt_start_desc'], "text"), GetSQLValueString($_POST['mounted_desc'], "text"), GetSQLValueString($_POST['follow_up_desc'], "text"), GetSQLValueString($_POST['refinement_desc'], "text"), GetSQLValueString($_POST['restarting_desc'], "text"), GetSQLValueString($_POST['priv_sess_ranch'], "text"), GetSQLValueString($_POST['priv_sess_facility'], "text"), GetSQLValueString($_POST['group_lessons'], "text"), GetSQLValueString($_POST['discount_coupons'], "text"), GetSQLValueString($_POST['sess_desc'], "text"), GetSQLValueString($_POST['sandf_facility'], "text"), GetSQLValueString($_POST['sandf_id'], "int")); $query_getSandF = sprintf("SELECT * FROM sandf WHERE sandf_id = %s", GetSQLValueString($colname_getSandF, "int")); $getSandF = mysql_query($query_getSandF, $blogAdmin) or die(mysql_error()); $row_getSandF = mysql_fetch_assoc($getSandF); $totalRows_getSandF = mysql_num_rows($getSandF);
#2: on my sandv.php page, how do I access these image files? Which table do I use to SELECT the information to retrieve on my sandf.php page?
Currently my code is:
I hope I'm not overwhelming anyone, but I've been puzzling over this for weeks and would appreciate any expertise!Code:$query_getSandF = "SELECT * FROM sandf ORDER BY sandf.sandf_id DESC LIMIT 1"; $getSandF = mysql_query($query_getSandF, $sandfquery) or die(mysql_error()); $row_getSandF = mysql_fetch_assoc($getSandF); $totalRows_getSandF = mysql_num_rows($getSandF);
I thank you for your time,
Heather








Bookmarks