mallen
-
Posts
316 -
Joined
-
Last visited
Community Answers
-
mallen's post in Storing array values from form was marked as the answer
I think I finally got it working. Thanks again for helping me through this. I have learned more about arrays than I ever have.
<input type="hidden" name="ords[]" <?php if($editProduct) echo "value='{$cat['p_order']}'"; ?>/> --------------------------------------------- $ords = $_REQUEST['ords']; $catCategory = "INSERT INTO category_assoc (prod_id, cat_id, p_order) VALUES('$lastID', '". $cats[$i] . "','". $ords[$i] . "')"; --------------------------------------------- I think the quote marks were an issue. Also these two parts. $ords[$i] name="ords[]" -
mallen's post in using Strrchr to get end of string was marked as the answer
$THEURL = "SELECT Image_URL From ... ect";//the query
$image = $wpdb->get_row($THEURL, ARRAY_A);//the variable is dynamic
var_dump(substr(strrchr($image,'/'),1)); fails
var_dump(substr(strrchr('http://somewebsite.com/images/image1.jpg','/'),1)); gives 'image1.jpg'
var_dump($image); // gives 'http://somewebsite.com/images/image1.jpg'
I figured it out:
var_dump(substr(strrchr($image['Image_URL'],'/'),1));