Jump to content

can any one tell me is it possible to update query two times


Recommended Posts

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>

<?

}

}

?>

Edited by ksumanth

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 ) ;

 

?>

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.