LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 12-28-2011, 09:48 AM   #1
PradeepRahul
LQ Newbie
 
Registered: Dec 2011
Location: Chennai
Posts: 10

Rep: Reputation: Disabled
PHP parse error unexpected '>'


<?php
$hostname = "localhost";
$user = "root";
$password = "";
$database = "customer";
$conn = mysql_connect($hostname,$user,$password) or die("Connection Not Found");
mysql_select_db($database);
$sql = mysql_query("SELECT * FROM a);
while($result = mysql_fetch_array($sql)) {
echo " <b>Name</b> = " .$result["name"] . " <br>";
echo " <b>Age</b> = " .$result["nick"] . " <br><br>----------------<br><br>";
}
?>

---------- Post added 12-28-11 at 09:19 PM ----------

Please somebody help me quick
 
Click here to see the post LQ members have rated as the most helpful post in this thread.
Old 12-28-2011, 10:26 AM   #2
JimBrewster
Member
 
Registered: Feb 2010
Location: usa:/dev/random
Distribution: Slackware-15.0; -current
Posts: 245

Rep: Reputation: 60
Quote:
Originally Posted by PradeepRahul View Post
<?php
$hostname = "localhost";
$user = "root";
$password = "";
$database = "customer";
$conn = mysql_connect($hostname,$user,$password) or die("Connection Not Found");
mysql_select_db($database);
$sql = mysql_query("SELECT * FROM a);
while($result = mysql_fetch_array($sql)) {
echo " <b>Name</b> = " .$result["name"] . " <br>";
echo " <b>Age</b> = " .$result["nick"] . " <br><br>----------------<br><br>";
}
?>

---------- Post added 12-28-11 at 09:19 PM ----------

Please somebody help me quick
Without trying it out or looking it up, I'd guess that '.$result[foo]' in lines 10 & 11 won't parse as a concatenation without a space after the '.'
 
Old 12-28-2011, 11:11 AM   #3
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 244Reputation: 244Reputation: 244
Missing matching quote in $sql = mysql_query("SELECT * FROM a);

(using text editor with colored syntax may help)
 
2 members found this post helpful.
Old 12-29-2011, 05:28 AM   #4
PradeepRahul
LQ Newbie
 
Registered: Dec 2011
Location: Chennai
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thanks alot for your reply!!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] Php Parse error (unexpected T_String) lpallard Programming 5 10-09-2011 11:19 PM
Parse error: syntax error, unexpected '@' in php code minipro Programming 1 06-14-2011 04:33 AM
PHP parse error: unexpected { li0n Programming 4 02-24-2009 05:12 AM
PHP Error Parse error: parse error, unexpected $ in /home/content/S/k/i/SkinCare4U/h CowanServices Programming 2 12-09-2008 08:26 PM
PHP parse error unexpected '>' ldp Programming 2 03-04-2005 02:20 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:09 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration