I got this Parse error: syntax error, unexpected T_STRING, expecting '(' in | Newbie | | Join Date: Oct 2008
Posts: 16
| |
Parse error: syntax error, unexpected T_STRING, expecting '(' in C:\wamp\www\study_group\includes\functions.php on line 19
I got this error and this syntax is from 8 to 19th line. - <?php
-
$subject_set = get_all_subjects();
-
while ($subject = mysql_fetch_array($subject_set)) {
-
echo "<li>{$subject["menu_name"]}</li>";
-
$page_set = get_pages_for_subject($subject["id"]);
-
echo "<ul class=\"pages\">";
-
while ($page = mysql_fetch_array($page_set)) {
-
echo "<li>{$page["menu_name"]}</li>";
-
}
-
echo "</ul>";
-
}
-
?>
end of 19th line.
I'd be your slave after this so please help me.
|  | Moderator | | Join Date: Jun 2007 Location: York, England, with wolves.
Posts: 4,952
| | | re: I got this Parse error: syntax error, unexpected T_STRING, expecting '(' in
With PHP, you're lucky if the error is on the line it tells you.
Post the full code, so we can match up the line numbers.
Remember to use [code] tags! (just highlight your code, then hit the # button on the editor).
Cheers.
| | Newbie | | Join Date: Oct 2008
Posts: 16
| | | re: I got this Parse error: syntax error, unexpected T_STRING, expecting '(' in
Thanx.
I really think theres no parenthesis missing in this code. since i've been figuring this since yesterday. And I really need help. - <?php require_once("includes/connection.php"); ?>
-
<?php require_once("includes/functions.php"); ?>
-
<?php include("includes/header.php"); ?>
-
<table id=structure>
-
<tr>
-
<td id="navigation">
-
<ul class="subjects">
-
<?php
-
$subject_set = get_all_subjects();
-
while ($subject = mysql_fetch_array($subject_set)) {
-
echo "<li>{$subject["menu_name"]}</li>";
-
$page_set = get_pages_for_subject($subject["id"]);
-
echo "<ul class=\"pages\">";
-
while ($page = mysql_fetch_array($page_set)) {
-
echo "<li>{$page["menu_name"]}</li>";
-
}
-
echo "</ul>";
-
}
-
?>
-
</ul>
-
</td>
-
<td id="page">
-
<h2>About Us</h2>
-
-
</td>
-
</tr>
-
</table>
-
<?php require("includes/footer.php"); ?>
|  | Moderator | | Join Date: Jun 2007 Location: York, England, with wolves.
Posts: 4,952
| | | re: I got this Parse error: syntax error, unexpected T_STRING, expecting '(' in
Silly us! Looking back at the error, it says the problem is with C:\wamp\www\study_group\includes\functions.php.
So, post up the code from that file.
Cheers.
| | Newbie | | Join Date: Oct 2008
Posts: 16
| | | re: I got this Parse error: syntax error, unexpected T_STRING, expecting '(' in - <?php
-
function confirm_query($result_set) {
-
if (!$result_set) {
-
die("Database query failed: " . mysql_error());
-
}
-
}
-
-
function get_all_subjects() {
-
global $connection;
-
$query = "SELECT *
-
FROM subjects
-
ORDER BY position ASC";
-
$subject_set = mysql_query($query, $connection);
-
confirm_query($subject_set);
-
return $subject_set;
-
}
-
-
function get_pages_for subject($subject_id) {
-
global $connection;
-
$query = "SELECT *
-
FROM pages
-
WHERE subject_id = {$subject_id}
-
ORDER BY position ASC";
-
$page_set = mysql_query($query, $connection);
-
confirm_query($page_set);
-
return $page_set;
-
}
-
?>
My mistake I didnt put it from the start. i was looking at the above page since Its were the error is. and i've also check this file too.
Or i'm just so new to php.
|  | Moderator | | Join Date: Jun 2007 Location: York, England, with wolves.
Posts: 4,952
| | | re: I got this Parse error: syntax error, unexpected T_STRING, expecting '(' in
Check out line 18. Look at the function name.
I'm not giving answers today! I'm giving hints.
:P
| | Newbie | | Join Date: Oct 2008
Posts: 16
| | | re: I got this Parse error: syntax error, unexpected T_STRING, expecting '(' in
It got me days to find out that an underscore is a problem.
God bless you Markus
And oh I'm sorry. I'm not sure if i'd be willing to be your slave.
since you only give me the hint. :P
Thanx.
|  | Moderator | | Join Date: Jun 2007 Location: York, England, with wolves.
Posts: 4,952
| | | re: I got this Parse error: syntax error, unexpected T_STRING, expecting '(' in Quote:
Originally Posted by benicio It got me days to find out that an underscore is a problem.
God bless you Markus
And oh I'm sorry. I'm not sure if i'd be willing to be your slave.
since you only give me the hint. :P
Thanx. I have lawyers on standby. Refuse what you promised me, and be thrown to the dogs!
| | Newbie | | Join Date: Oct 2008
Posts: 16
| | | re: I got this Parse error: syntax error, unexpected T_STRING, expecting '(' in
Mercy please. Have mercy.. Woohff woohff!
I can be your dog instead!
Anyway, please provide me a link to the instructions to manupulate the GUI of the phpadmin.
It dont seem right, dyou know what are syntax to write in the console to make my links visible?
|  | Moderator | | Join Date: Jun 2007 Location: York, England, with wolves.
Posts: 4,952
| | | re: I got this Parse error: syntax error, unexpected T_STRING, expecting '(' in Quote:
Originally Posted by benicio Mercy please. Have mercy.. Woohff woohff!
I can be your dog instead!
Anyway, please provide me a link to the instructions to manupulate the GUI of the phpadmin.
It dont seem right, dyou know what are syntax to write in the console to make my links visible? A dog will do. For now.
@ second part. Huh? I don't understand your question. Also, if this question has nothing to do with the original thread: post a new thread asking the question.
Best regards,
Your owner,
Mark.
| | Newbie | | Join Date: Oct 2008
Posts: 16
| | | re: I got this Parse error: syntax error, unexpected T_STRING, expecting '(' in
Okay. But then I'm gonna do that later. I think I'm gonna have to do and learn this on my own for now. After all you don't need a dog, you actually own lots of dogs here.
|  | | | | Forums
Visit our community forums for general discussions and latest on Bytes
/bytes/about
We are a network of experts and professionals in IT and software development that help one another with answers to tough questions and share insights.
Get the best answers to your questions from over 226,567 network members.
|