Jump to content

t_variable driving me crazy, maybe another set of eyes will help?


bruckerrlb

Recommended Posts

I have a pretty beautiful script here, but I keep getting the unexpected t_variable error, I checked all the problems I know to exist with the T_variable, I check all the lines above the other and it keeps giving me the t_variable, maybe someone can spot something in the bigger picture i'm missing?

 

<?php

//This was the first problem, but I re-wrote it and it worked fine

$startdate = $_POST['startdate'];

$enddate = $_POST['enddate'];

$starthour = $_POST['starthour'];

$endhour = $_POST['endhour'];

$product = $_POST['productname'];

            //this was the second error, but I rewrote it, and then it gave me the error below in navy color

$query = "SELECT * FROM products WHERE productname = '$productname'";

    // bring back the query into a variable

 

$r = mysql_query($query, $local_db);

    // Get the product id

    list($productid) = mysql_fetch_array($r);

 

    //query the remote database for the specific user

    $query = "SELECT * FROM ei10800010001200708 WHERE NumeroExterno = '$productid' AND " .

             "FechaDesde > '$startdate' AND FechaHasta < '$enddate' AND HoraDesde > '$starthour' AND HoraFecha < '$endhour'";

 

    mysql_query($query, $remote_db) or die ("Could not perform query:<br />\n$query<br />\n" . mysql_error($remote_db));

 

    while ($row = mysql_fetch_array($r))

    {

?>

it is defined in the top of the page

<?php

ini_set ('display_errors', 1);
error_reporting (E_ALL & ~E_NOTICE);

require_once('auth.php');

// Local Database connection
$local_db = mysql_connect('localhost','root');

mysql_select_db('users', $local_db);
// Remote Database connection
$remote_db = mysql_connect('192.168.1.2', 'someuser', 'somepassword');
mysql_select_db('eisw', $remote_db);

?>

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.