Smarty Forum Index Smarty
WARNING: All discussion is moving to https://reddit.com/r/smarty, please go there! This forum will be closing soon.

select & delete mysql queries

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
superman
Smarty Rookie


Joined: 08 Jul 2003
Posts: 11

PostPosted: Sat Jul 19, 2003 3:57 am    Post subject: select & delete mysql queries Reply with quote

i've try to insert and delete record at the same page, but it only can insert and can't delete the record.
when i click submit button from the previous form, the record is insert into table B and delete from the table A.
is the code correct?


<? $Connect = mysql_connect("localhost","root","");
mysql_select_db("mw");
$TodayDate = strftime("%Y-%m-%d");
$TodayTime = strftime("%H:%M:%S");
$result=mysql_query("insert into LeaveApplication1 (StaffID, LeaveType, JobTitle, FromDate, ToDate, Duration, Reason, TodayDate, TodayTime) values ('$StaffID', '$LeaveType', '$JobTitle', '$FromDate', '$ToDate', '$Duration', '$Reason', '$TodayDate')");

$result=mysql_query("delete from LeaveApplication where StaffID='$StaffID' and LeaveType='$LeaveType' and JobTitle='$JobTitle' and FromDate='$FromDate' and ToDate='$FromDate' and Duration='$Duration' and Reason='$Reason' and TodayDate='$TodayDate' and TodayTime='$TodayTime'");
mysql_close();
?>
Back to top
View user's profile Send private message
AZTEK
Smarty Pro


Joined: 16 Apr 2003
Posts: 235
Location: Purdue University

PostPosted: Sat Jul 19, 2003 2:04 pm    Post subject: Reply with quote

Even though this has nothing to do with Smarty Smile

insert into LeaveApplication1 and
delete from LeaveApplication

your using two different tables there.
_________________
"Imagine a school with children that can read and write, but with teachers who cannot, and you have a metaphor of the Information Age in which we live." -Peter Cochrane
Back to top
View user's profile Send private message Visit poster's website
superman
Smarty Rookie


Joined: 08 Jul 2003
Posts: 11

PostPosted: Sun Jul 20, 2003 8:14 am    Post subject: Reply with quote

thanx
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP