Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Syntax Error help

New Here ,
Mar 15, 2010 Mar 15, 2010

I am using php and mysql for this application.

<?php

include_once('config.php');

$user = $_POST['username'];

$pass = md5($_POST['password']);

$connection = @mysql_connect($server, $dbusername, $dbpassword) or die(mysql_error());

$db = @mysql_select_db($db_name,$connection)or die(mysql_error());

$sql = "SELECT usr_id FROM $tb_users WHERE usr_username = '$user' and usr_password = '$pass'"; //line 12

$result = @mysql_query($sql,$connection) or die(mysql_error());

$num_rows = mysql_num_rows($result);

?>

I am getting the following error:

Parse error: syntax error, unexpected '=' in /home/admin/public_html/SMET/scripts/config.php on line 12

I can not locate the issue where this problem is occurring, any help would be appreciated.

p.s. Also I just included the portion of code that is effected on my script and marked line 12 as a comment.

~justin

TOPICS
Server side applications
417
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Mar 15, 2010 Mar 15, 2010

It's telling you the error is in config.php. You should post the contents of that script instead.

Translate
LEGEND ,
Mar 15, 2010 Mar 15, 2010

It's telling you the error is in config.php. You should post the contents of that script instead.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 15, 2010 Mar 15, 2010
LATEST

forgot to place a $ sign on a variable in my config file. Didn't even look at it closely...Thank you

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines