Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
Help with multiple queries
Old 09-21-2011, 03:17 PM Help with multiple queries
Skilled Talker

Posts: 96
Name: Joan
Trades: 0
Hello, i am trying to run 2 sql queries on a page but only the first one works the queries are correct because if i change the order it is always the one on top that runs and the other one won't run, it doesn't show any error or anything, does anyone know why does this happen? here is the code..

PHP Code:
$ctime time();
            
            
$ttime strtotime($row['date'] . " " $row['time']);
            
$diff $ttime $ctime;
            if (
$diff 0)
            {
                
$diff $diff;
                
$passed_time $diff;
                
$past true;
                
// if passed time is 40 min and task is 1 send chat to supervisor
                
if ($passed_time 7200 && $dismiss == "no" && $task == "1"){
            
$msg "Counselor "$counselor" has not done task: ".$task_name." for case $case_no .";
            
$sql "INSERT INTO chat VALUES('','$admin_id',$user_id,'".$msg."','".time()."','0','0')";
            
$exe mysql_query($sql); if(!$exe){echo mysql_error();}
                
                
$sqlu "UPDATE task_manager_cases SET dismiss = 'yes' where `case_#` = '$case_no'";
                
$exec mysql_query($sqlu); if(!$exec){echo mysql_error();}
            } 
here the chat is sent to the supervisor but i need to update the column dismiss to no so the chat won't appear again, i only need the chat to be sent once, and the reason why it will appear again is because the page refreshes every 5 min. thanks

Last edited by stivens; 09-21-2011 at 03:59 PM..
stivens is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 09-22-2011, 02:57 AM Re: Help with multiple queries
Skilled Talker

Posts: 96
Name: Joan
Trades: 0
NVM problem was solved. thanks.
stivens is offline
Reply With Quote
View Public Profile
 
Old 09-23-2011, 09:17 PM Re: Help with multiple queries
Physicsguy's Avatar
404 - Title not found

Posts: 920
Name: Scott Kaye
Location: Ontario
Trades: 0
Could you please post your solution? This will help people who find this using Google or the TT search.

Thanks!
__________________
Check out my
Please login or register to view this content. Registration is FREE
or my
Please login or register to view this content. Registration is FREE
!
Physicsguy is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to Help with multiple queries
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.32336 seconds with 12 queries