php - Parse error again and again -


this topic has been posted several times solutions posted here in doesn't seem help. have checked on semicolons, spaces , query still receiving parse error on php whenever call subjaccess.php.

parse error: syntax error, unexpected t_string in /home/a8367888/public_html/subjaccessrequest.php on line 14 

here php code:

<?php $mysql_hostname = "localhost"; $mysql_database = "database"; $mysql_user = "username"; $mysql_password = "password";  //$pass = $_post['email']; $pass = "blahblach@gmail.com";  $bd = mysql_connect($mysql_hostname, $mysql_user, $mysql_password) or die("opps went wrong"); mysql_select_db($mysql_database, $bd) or die("oops went wrong");  $query =  "select (a.acode) "access_id", (s.s_first_name) "fname",      (s.s_middle_initial) "mname", (s.s_last_name) "lname", (a.s_email) "email", (a.req_subj) "subjcode" access a, student s a.s_email = s.s_email , a.t_email = '$pass'  , a.access_status = "pending";  $result = mysql_query($query) or die('mysql error' . mysql_error());  while ($row = mysql_fetch_array($result)) {  $res[]=array('aid'=> $row['access_id'],'fname'=> $row['fname'],'mname'=> $row['mname'], 'lname'=> $row['lname'], 'email'=> $row['email'], 'subj'=> $row['subjcode']); }  echo '$res';  $response['request'] = $res; print(json_encode($response)); ?> 

hoping responses.

change

$query =  "select (a.acode) "access_id", (s.s_first_name) "fname",      (s.s_middle_initial) "mname", (s.s_last_name) "lname", (a.s_email) "email", (a.req_subj) "subjcode" 

to

$query =  "select (a.acode) 'access_id', (s.s_first_name) 'fname',      (s.s_middle_initial) 'mname', (s.s_last_name) 'lname', (a.s_email) 'email', (a.req_subj) 'subjcode' 

Comments

Popular posts from this blog

php - Why I am getting the Error "Commands out of sync; you can't run this command now" -

linux - Does gcc have any options to add version info in ELF binary file? -

java - Are there any classes that implement javax.persistence.Parameter<T>? -