Jump to content

PHP run query


tebrown

Recommended Posts

Hey Guys,

 

I have setup a mysql query that is run everytime the page is refreshed. Its on my page called secure.php, which is on everypage within my website.

 

At the moment it finds all the fixtures in the database and checks if the current time has passed its specific time. It all works fine but im wanting to get that specific fixture_id so that i can then send a notification to the manager saying that the current time has passed ur fixture time.

 

$fixture = ("SELECT * FROM `fixtures`") or die(mysql_error());
$resultfixture=mysql_query($fixture);

if (mysql_num_rows($resultfixture) != 0) {
while($rows = mysql_fetch_array($resultfixture)) {

	mysql_query("UPDATE `fixtures` SET `status` = '2', `result`='TBA' WHERE UNIX_TIMESTAMP() > `time` AND `status`='1'") or die(mysql_error());  
}

}

 

Any help much appreciated!

 

Cheers

Link to comment
Share on other sites

Ok so lets say that msyql query runs and it finds 1 fixture that has passed its fixture time, i want to be able to get the id of that fixture so i can then run a another mysql_query that will notify the manager to let him know the current time has passed the fixture time.

 

Hope that makes sense.

Link to comment
Share on other sites

I need to update all fixtures where the current time has passed the fixture time. The query will then update the column 'status' to '2'.

 

I then need to GET the fixtures that it just updated so i can run another query that will notify the managers of those fixtures.

 

 

Link to comment
Share on other sites

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.