Jump to content

First value of Array


NONAME_2

Recommended Posts

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.

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.