hi,
i am trying to upload an image with comment......!!

mycode is like below......

if($_POST){
getting posted variables for comment
mysql_query(adding into database);

if(image is posted){now getting image variables
mysql_query(inserting into database);
}
}

if works fine for me but problem is that i have two different tables one for comment and one for image........!! i want to add current user id also into image table but it is not passing to table but rest of code is working all the way fine..........!! how can i do that

hi,
i am trying to upload an image with comment......!!

mycode is like below......

if($_POST){
getting posted variables for comment
mysql_query(adding into database);

if(image is posted){now getting image variables
mysql_query(inserting into database);
}
}

if works fine for me but problem is that i have two different tables one for comment and one for image........!! i want to add current user id also into image table but it is not passing to table but rest of code is working all the way fine..........!! how can i do that

your code need to be like this -

if(isset($_POST['submit_btn_name']) && $_POST['submit_btn_name'] !='')
{
//your code
}

but boss i am trying to make facebook like commentsystem.......!!
that if just comment is typed and submit it hit, it just post comment,but if user wants to attach any photo that it attach a photo........!!

but boss i am trying to make facebook like commentsystem.......!!
that if just comment is typed and submit it hit, it just post comment,but if user wants to attach any photo that it attach a photo........!!

There might be some logical error, that's why your user_id is not getting inserted in the image table.
Post the code here

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.