NONAME_2 Posted February 8, 2011 Share Posted February 8, 2011 Hi all, i want upload 3 images .they upload in definded path complete but my first value in array newsimg[0] in insert, is empty: my code: $query = "INSERT INTO news SET postdate=NOW(),". "ttl='$title', newstxt='$description', ". "isprv='$isprv',authr='$login' "; if (isset($newsimg[0])) $query .=",newsimg1='$newsimg[0]'" ; if (isset($newsimg[1])) $query .=",newsimg2='$newsimg[1]'" ; if (isset($newsimg[2])) $query .=",newsimg3='$newsimg[2]'" ; if (mysql_query($query)) { echo "<pre>"; print_r($newsimg); echo "</pre>"; } Sample Result: Array ( [] => 1297148403tulips 04.jpg [1] => 1297148404tulips 03.jpg [2] => 1297148405tulips 02.jpg ) Can i use `0` instead of 0 for my value('s) array. TNX. Quote Link to comment Share on other sites More sharing options...
NONAME_2 Posted February 8, 2011 Author Share Posted February 8, 2011 Can i use `0` instead of 0 for my value('s) array. it isn't a good idea , any answer freinds? Quote Link to comment Share on other sites More sharing options...
BlueSkyIS Posted February 8, 2011 Share Posted February 8, 2011 how are you adding items to $newsimg? Quote Link to comment Share on other sites More sharing options...
NONAME_2 Posted February 9, 2011 Author Share Posted February 9, 2011 how are you adding items to $newsimg? Thank you blueskyIS, my solution was in var like $ctr that not initialized.TNX. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.