Jump to content

[SOLVED] need help T_STRING error, Help please someone!!


jamesxg1

Recommended Posts

Here's the code:

 

<?php
$user_id = mysql_real_escape_string($_GET['id']);
$sql = "SELECT * FROM `users` WHERE `id`='$id' LIMIT 1";
$query = mysql_query($sql);
if(mysql_num_rows($query) > 0){
display content
}else{
 the user does not exist
}
?>

 

This is the error:

 

Parse error: syntax error, unexpected T_STRING in C:\xampp\htdocs\profile.php on line 7

 

James.

<?php
$user_id = mysql_real_escape_string($_GET['id']);
$sql = "SELECT * FROM `users` WHERE `id`='$id' LIMIT 1";
$query = mysql_query($sql);
if(mysql_num_rows($query) > 0){
//display content
}else{
//the user does not exist
}
?>

 

You need to comment your comments

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.