Symbianize Forum

Most of our features and services are available only to members, so we encourage you to login or register a new account. Registration is free, fast and simple. You only need to provide a valid email. Being a member you'll gain access to all member forums and features, post a message to ask question or provide answer, and share or find resources related to mobile phones, tablets, computers, game consoles, and multimedia.

All that and more, so what are you waiting for, click the register button and join us now! Ito ang website na ginawa ng pinoy para sa pinoy!

delete and update at the same time, help plssss.......

Status
Not open for further replies.

junelle13

Apprentice
Advanced Member
Messages
60
Reaction score
0
Points
26
hi po, pa help naman po sa problema ko. my isang page kasi sa web project ko na nag aactivate ng schedule, tapos may table ito na "scheduleactivate" ang name. if mag aactivate ako ng sched maiinsert ito sa table("scheduleactivate"), tapos kung ang current date is equal to enddate ay madedelete lahat sa table("scheduleactivate"). the problem is gusto ko sana kung madelete na lahat sa table("scheduleactivate"), may ma uupdate sa kabilang table("setschedule"). eto po sample ng codes ko..

$sql = "DELETE FROM scheduleactivate WHERE CURDATE() >= enddate";

if ($con->query($sql) === TRUE)
{
$sql = "SELECT * FROM scheduleactivate where status='activate'";

$result = mysqli_query($con, $sql);

if(mysqli_num_rows($result) != 0)
{
while($row=mysqli_fetch_array($result))
{


}
}
else
{
$sql1 = "UPDATE setschedule SET
status='done'";
if ($con->query($sql1) === TRUE) { }
}
}
else
{

}
$con->close();

sa ngayon eto ang ginagamit ko na codes, but the problem is kung mag seset ako ng schedule="undone" tapos wala hindi pa naka activate ang schedule pag pupunta ako sa scheduleactivate.php na page, ma "done" ito kasi mag ru run ang "SELECT * FROM scheduleactivate where status='activate'"; which is wala so magiging "done" ito. however kung mag aactivate muna ako ng schedule, tapos mag set ng schedule. pag punta ko sa scheduleactivate.php, "undone" parin kasi meron ng laman ang table("scheduleactive").



tinry ko din eto, kaso everytime pupunta ako sa scheduleactivate.php na page. magiging "done" sya kahit meron or walang laman ang table("scheduleactivate")..

$sql = "DELETE FROM scheduleactivate WHERE CURDATE() >= enddate";

if ($con->query($sql) === TRUE)
{
$sql1 = "UPDATE setschedule SET
status='done'";
if ($con->query($sql1) === TRUE) { }

}
else
{

}
$con->close();

pa help naman po ngayong thursday na yung defense namin mejo madami pang kulang, sa ngayun eto ang major na kulang sa project ko. :pray::pray:
 
Last edited:
hi po, pa help naman po sa problema ko. my isang page kasi sa web project ko na nag aactivate ng schedule, tapos may table ito na "scheduleactivate" ang name. if mag aactivate ako ng sched maiinsert ito sa table("scheduleactivate"), tapos kung ang current date is equal to enddate ay madedelete lahat sa table("scheduleactivate"). the problem is gusto ko sana kung madelete na lahat sa table("scheduleactivate"), may ma uupdate sa kabilang table("setschedule"). eto po sample ng codes ko..

$sql = "DELETE FROM scheduleactivate WHERE CURDATE() >= enddate";

if ($con->query($sql) === TRUE)
{
$sql = "SELECT * FROM scheduleactivate where status='activate'";

$result = mysqli_query($con, $sql);

if(mysqli_num_rows($result) != 0)
{
while($row=mysqli_fetch_array($result))
{


}
}
else
{
$sql1 = "UPDATE setschedule SET
status='done'";
if ($con->query($sql1) === TRUE) { }
}
}
else
{

}
$con->close();

sa ngayon eto ang ginagamit ko na codes, but the problem is kung mag seset ako ng schedule="undone" tapos wala hindi pa naka activate ang schedule pag pupunta ako sa scheduleactivate.php na page, ma "done" ito kasi mag ru run ang "SELECT * FROM scheduleactivate where status='activate'"; which is wala so magiging "done" ito. however kung mag aactivate muna ako ng schedule, tapos mag set ng schedule. pag punta ko sa scheduleactivate.php, "undone" parin kasi meron ng laman ang table("scheduleactive").



tinry ko din eto, kaso everytime pupunta ako sa scheduleactivate.php na page. magiging "done" sya kahit meron or walang laman ang table("scheduleactivate")..

$sql = "DELETE FROM scheduleactivate WHERE CURDATE() >= enddate";

if ($con->query($sql) === TRUE)
{
$sql1 = "UPDATE setschedule SET
status='done'";
if ($con->query($sql1) === TRUE) { }

}
else
{

}
$con->close();

pa help naman po ngayong thursday na yung defense namin mejo madami pang kulang, sa ngayun eto ang major na kulang sa project ko. :pray::pray:

WHERE enddate

- - - Updated - - -

pwede mo po ba i pakita ang table structure po nito?
scheduleactivate at setschedule
 
Status
Not open for further replies.
Back
Top Bottom