ksumanth Posted January 28, 2013 Share Posted January 28, 2013 Hello friends, I have a form that contains 3fields 1.Title 2.description 3.Image The problem is while editing(UpdatingImage) While submitting the form i written two queries in updateprocess.php updateprocess.php if(isset($_POST['submit'])) { if($image == "") { $query1 = "update tblnews_details set heading='$tbl_heading',description='$description' where news_id='$frm_id'"; ?> <script language="javascript"> location.href = "ViewApproveNews.php"; </script> <? } } ?> Link to comment https://forums.phpfreaks.com/topic/273730-can-any-one-tell-me-is-it-possible-to-update-query-two-times/ Share on other sites More sharing options...
gerkintrigg Posted January 28, 2013 Share Posted January 28, 2013 Does this answer your question: $q="INSERT INTO accounting (`item_name`, `description`, `date`, `cost`, `sector` ) VALUES ( '$item_name', '$description', '$insert_date', '$cost', '$sector' );"; $sql=mysql_query($q); $record_id=mysql_insert_id(); if (!empty($_FILES['img']['tmp_name'])){ // for the main image: $image = new SimpleImage(); $image->load($_FILES['img']['tmp_name']); $image->resizeToWidth(600); $image->save($root.'members/admin/accounting/images/'.$year.'-'.$month.'-'.$day.'_'.$record_id.'.jpg'); $img='members/admin/accounting/images/'.$year.'-'.$month.'-'.$day.'_'.$record_id.'.jpg'; $q="UPDATE `accounting` SET `img` = '$img' WHERE `id`='$record_id';"; $sql=mysql_query($q); } $go='index.php'; header( 'Location: '.$go ) ; ?> Link to comment https://forums.phpfreaks.com/topic/273730-can-any-one-tell-me-is-it-possible-to-update-query-two-times/#findComment-1408718 Share on other sites More sharing options...
Barand Posted January 28, 2013 Share Posted January 28, 2013 On 1/28/2013 at 11:41 AM, gerkintrigg said: Does this answer your question: What question? All we know is there is an unspecified problem. Link to comment https://forums.phpfreaks.com/topic/273730-can-any-one-tell-me-is-it-possible-to-update-query-two-times/#findComment-1408733 Share on other sites More sharing options...
gerkintrigg Posted January 28, 2013 Share Posted January 28, 2013 I have no idea what the problem / question is either, which is why I asked if I solved it... Link to comment https://forums.phpfreaks.com/topic/273730-can-any-one-tell-me-is-it-possible-to-update-query-two-times/#findComment-1408737 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.