Jump to content

T_VARIABLE help


jamesxg1

Recommended Posts

<?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

Link to comment
https://forums.phpfreaks.com/topic/153226-t_variable-help/
Share on other sites

<?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

Link to comment
https://forums.phpfreaks.com/topic/153226-t_variable-help/#findComment-804941
Share on other sites

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 :)

Link to comment
https://forums.phpfreaks.com/topic/153226-t_variable-help/#findComment-804970
Share on other sites

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++;
}
?>

Link to comment
https://forums.phpfreaks.com/topic/153226-t_variable-help/#findComment-804974
Share on other sites

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.