bruckerrlb Posted August 5, 2007 Share Posted August 5, 2007 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)) { ?> Quote Link to comment https://forums.phpfreaks.com/topic/63443-t_variable-driving-me-crazy-maybe-another-set-of-eyes-will-help/ Share on other sites More sharing options...
almightyegg Posted August 5, 2007 Share Posted August 5, 2007 $productname should be $product if you look at your $_POST section Quote Link to comment https://forums.phpfreaks.com/topic/63443-t_variable-driving-me-crazy-maybe-another-set-of-eyes-will-help/#findComment-316169 Share on other sites More sharing options...
bruckerrlb Posted August 5, 2007 Author Share Posted August 5, 2007 Thanks AlmightyEgg, that was sure to cause me problems, but that didn't fix immediate the problem it is still telling me there is an unexpected t_variable in the same place Quote Link to comment https://forums.phpfreaks.com/topic/63443-t_variable-driving-me-crazy-maybe-another-set-of-eyes-will-help/#findComment-316171 Share on other sites More sharing options...
Barand Posted August 5, 2007 Share Posted August 5, 2007 No t_var error but do get unexpected end, not surprisingly. Quote Link to comment https://forums.phpfreaks.com/topic/63443-t_variable-driving-me-crazy-maybe-another-set-of-eyes-will-help/#findComment-316173 Share on other sites More sharing options...
almightyegg Posted August 5, 2007 Share Posted August 5, 2007 Where is $localdb defined??/ Quote Link to comment https://forums.phpfreaks.com/topic/63443-t_variable-driving-me-crazy-maybe-another-set-of-eyes-will-help/#findComment-316178 Share on other sites More sharing options...
bruckerrlb Posted August 5, 2007 Author Share Posted August 5, 2007 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); ?> Quote Link to comment https://forums.phpfreaks.com/topic/63443-t_variable-driving-me-crazy-maybe-another-set-of-eyes-will-help/#findComment-316183 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.