1

I have the following php script that I need to schedule to run in phpmyadmin. I am using a cron to run it but its not updating the table. It is not giving me an error either so I am sure something is wrong with my php file. Here is the code.

<?php
mysql_connect("xxxx", "xxxx", "xxxx") or die(mysql_error());
mysql_select_db("xxxx") or die(mysql_error());

$query = "update events 
INNER JOIN tblfeatureddj 
ON events.id_user = tblfeatureddj.id_user 
set trending ='2'";

?>
Steven
  • 401
  • 3
  • 7
  • 21
  • Are u sure the cron is set up properly. Most controlpanel require u start the location of your script from your home folder – DarkBee Apr 03 '14 at 18:59
  • Post the command for your cron. Also, stop using `mysql_` functions. – Kermit Apr 03 '14 at 19:00
  • 1
    The cron is built into the network solutions control panel, its just picking a file to run and the frequency. – Steven Apr 03 '14 at 19:02
  • I'm not familiar with the network solutions control panel, but most cron jobs are command line commands -- you'll need to find out if it's expecting a command to execute or how the interface wants you to provide input. If I understand you correctly, there's no where for you to type anything and you just select the file from a dropdown menu? – Isaac Bennetch Jun 16 '14 at 20:18

1 Answers1

4

You can indeed schedule events from within phpMyAdmin (provided you have the proper permissions, of course). From within your database, click the Events tab. From there, you can add a new event (and turn on the "Event scheduler status" button, if the scheduler is turned off). Something like this should do nicely for you:

Event scheduler interface

Isaac Bennetch
  • 11,830
  • 2
  • 32
  • 43
  • Although I don't think this feature existed in 3.3.8.1. You should really upgrade anyway, though, as that version is more than four years old at this point. – Isaac Bennetch Jun 16 '14 at 20:33