Hi
Unfortunately my hosting company won't allow me to run triggers.
So I'm trying the PHP route, I've set up a form to input the user_id, the odometer reading and the date, on Submit it loads a page with your PHP code on it, I've added the db connection,
Code:
<?php
// CODE TO GET RECORDS FROM DATABASE GOES HERE
$con = mysql_connect("localhost", "username", "password");
if (!$con)
{
die('Could not connect: ' . mysql_error());
}
$db_selected = mysql_select_db("db_name",$con);
$sql = "SELECT `user_id`, `odometer`, `monthly_mileage`, `date` FROM `mileage`";
$result = mysql_query($sql,$con);
But nothing appears on the page and the db doesn't get updated. I've assumed I needed to add something to this line,
Code:
$rows = '';// array of rows from database results
as nothing seemed to happen, so tried this,
Code:
$row = '$query->last_row()';
and this,
$row = '$query->row(5)';
Not sure what to do now.
Bookmarks