jamesxg1 Posted April 8, 2009 Share Posted April 8, 2009 <?php session_start(); ini_set('display_errors', 1); error_reporting(E_ALL); include 'Database/Connection.php'; include 'Database/Utility.php'; isloggedin(); accessneeded("C") $userid = $_SESSION['userid']; $count = 0; $query = mysql_query(sprintf("SELECT * FROM contacts WHERE holder = '$userid'")) or die(mysql_error()); while ($row = mysql_fetch_object($query)) { if ($count!=0){echo "<hr>";} print "First Name: <font color=red>$row->firstname</font><br>"; print "Last Name: <font color=red>$row->lastname</font><br>"; print "Address: <font color=red>$row->address</font><br>"; print "Postcode: <font color=red>$row->postcode</font><br>"; print "Email: <font color=red>$row->email</font><br>"; print "Phone Number: <font color=red>$row->pnumber</font><br>"; $count++; } ?> Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\family\ContactsOverview.php on line 12 Quote Link to comment https://forums.phpfreaks.com/topic/153226-t_variable-help/ Share on other sites More sharing options...
jamesxg1 Posted April 8, 2009 Author Share Posted April 8, 2009 does anyone know what the problem is ? i remove $userid = $_SESSION['userid']; (line 12) and i still have the same problem :S Quote Link to comment https://forums.phpfreaks.com/topic/153226-t_variable-help/#findComment-804920 Share on other sites More sharing options...
revraz Posted April 8, 2009 Share Posted April 8, 2009 Missing semi colon here? isloggedin(); accessneeded("C") <--------- And give people more than 5 mins to look at your post Quote Link to comment https://forums.phpfreaks.com/topic/153226-t_variable-help/#findComment-804922 Share on other sites More sharing options...
jamesxg1 Posted April 8, 2009 Author Share Posted April 8, 2009 Missing semi colon here? isloggedin(); accessneeded("C") <--------- And give people more than 5 mins to look at your post hiya, ok changed it and still got nothing same error :S, and ok Quote Link to comment https://forums.phpfreaks.com/topic/153226-t_variable-help/#findComment-804928 Share on other sites More sharing options...
jamesxg1 Posted April 8, 2009 Author Share Posted April 8, 2009 ok iv pretty much tryed everything there is to try im very baffled :S someone please help :S Quote Link to comment https://forums.phpfreaks.com/topic/153226-t_variable-help/#findComment-804933 Share on other sites More sharing options...
revraz Posted April 8, 2009 Share Posted April 8, 2009 Post the new code and the current error. Quote Link to comment https://forums.phpfreaks.com/topic/153226-t_variable-help/#findComment-804935 Share on other sites More sharing options...
jamesxg1 Posted April 8, 2009 Author Share Posted April 8, 2009 <?php session_start(); ini_set('display_errors', 1); error_reporting(E_ALL); include 'Database/Connection.php'; include 'Database/Utility.php'; isloggedin(); accessneeded("C"); $userid = $_SESSION['userid']; $count = 0; $query = mysql_query(sprintf("SELECT * FROM contacts WHERE holder = '$userid'")) or die(mysql_error()); while ($row = mysql_fetch_object($query)) { if ($count!=0){echo "<hr>";} print "First Name: <font color=red>$row->firstname<br>"; print "Last Name: <font color=red>$row->lastname<br>"; print "Address: <font color=red>$row->address<br>"; print "Postcode: <font color=red>$row->postcode<br>"; print "Email: <font color=red>$row->email<br>"; print "Phone Number: <font color=red>$row->pnumber<br>"; $count++; } ?> Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\family\ContactsOverview.php on line 12 Quote Link to comment https://forums.phpfreaks.com/topic/153226-t_variable-help/#findComment-804941 Share on other sites More sharing options...
Maq Posted April 8, 2009 Share Posted April 8, 2009 Everything looks fine to me. Are you sure you're looking at the same page? Uploading it to the server (if you don't use local)? P.S. - The attributes should look like: Quote Link to comment https://forums.phpfreaks.com/topic/153226-t_variable-help/#findComment-804945 Share on other sites More sharing options...
jamesxg1 Posted April 8, 2009 Author Share Posted April 8, 2009 Everything looks fine to me. Are you sure you're looking at the same page? Uploading it to the server (if you don't use local)? P.S. - The attributes should look like: <font color='red'> im using local and yes definatly got the right script, and agreed it all seems ok to me but i guess to my localhost it dont lol Quote Link to comment https://forums.phpfreaks.com/topic/153226-t_variable-help/#findComment-804970 Share on other sites More sharing options...
jamesxg1 Posted April 8, 2009 Author Share Posted April 8, 2009 ok i got it so there are no errors but now its not displaying anything :S <?php session_start(); ini_set('display_errors', 1); error_reporting(E_ALL); include 'Database/Connection.php'; include 'Database/Utility.php'; isloggedin(); accessneeded("C"); $userid = $_SESSION['userid']; $count = 0; $query = mysql_query(sprintf("SELECT * FROM contacts WHERE holder = '$userid'")) or die(mysql_error()); while ($row = mysql_fetch_object($query)) { if ($count!=0){echo "<hr>";} print "First Name: <font color='red'>$row->firstname<br></font>"; print "Last Name: <font color='red'>$row->lastname<br></font>"; print "Address: <font color='red'>$row->address<br></font>"; print "Postcode: <font color='red'>$row->postcode<br></font>"; print "Email: <font color='red'>$row->email<br></font>"; print "Phone Number: <font color=red>$row->pnumber<br></font>"; $count++; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/153226-t_variable-help/#findComment-804974 Share on other sites More sharing options...
Maq Posted April 8, 2009 Share Posted April 8, 2009 You sure the session is started, you may need to add session_start(); to the top of your page. Echo it out to make sure. Or else $userid will be empty and the query won't return anything. Quote Link to comment https://forums.phpfreaks.com/topic/153226-t_variable-help/#findComment-804980 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.