Avatar of admiralrich
admiralrich

asked on 

How can I create a cron job to update a field?

I have database that i want to update every wednesday @ 12am. I have tried it,i am not getting any results. All i get is an email saying cron job with no errors but its not updating.

see the code and tell what is wrong..

What i want to do is update 1 field which is named "playing". I want the value be updated from "next" to "now"
<?php
$host="p50mysql49.secureserver.net"; // Host name
$username="frfilms"; // Mysql username
$password="Kamakazi1"; // Mysql password
$db_name="frfilms"; // Database name
$tbl_name="sunnyisle"; // Table name
 
// Connect to server and select database.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
 
$sql = "UPDATE $tbl_name SET playing='now' WHERE playing='next'"; 
$result=mysql_query($sql); 
 
?>
<?php
mysql_close();
?>

Open in new window

Windows Server 2003MySQL ServerScripting Languages

Avatar of undefined
Last Comment
Cornelia Yoder

8/22/2022 - Mon