Jump to content

display updated date of mysql table, but from another server


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.

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.