Jump to content

display updated date of mysql table, but from another server


busnut

Recommended Posts

G'day again. Still after doing more research, haven't been able to find a way to have a script running on someone else's server to look at my server to display the last updated date of my table.

 

This is the code so far, but what is needed so this code can be put on someone else's server? (thats if its possible?)

 

<?php
include("dbconnectionfilename");

// Otherwise we connect to our Database 
mysql_connect("$hostname", "$user", "$pass")or die("cannot connect"); 
mysql_select_db("$dbase")or die("cannot select DB");

$res = mysql_query("SHOW TABLE STATUS FROM bla_bla LIKE 'busfleet'") ;

echo "Last Updated: ". date('l, F j, Y @ h:ia', strtotime(mysql_result($res,0,'Update_time')));
?>

use mysql_connect to connect to the other database.

It may not work some hosting/shared hosting database allow only connection from 1 host for obivious security reason.

 

If you have access to the database with this server just make a script that output the data you want and file_get_content() it with the script on the others host.

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.