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.
10 5610
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.
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"); ?>
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.
- <?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.
Check out line 18. Look at the function name.
I'm not giving answers today! I'm giving hints.
:P
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.
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!
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?
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.
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.
Sign in to post your reply or Sign up for a free account.
Similar topics
by: Stuart Rogers |
last post by:
My hosting service uses PHP 4.3.10 and when I run a php script which works
perfectly on my local lan linux server on my hosting service I get this
error:-
Parse error: parse error, unexpected...
|
by: Ehartwig |
last post by:
I recently created a script for user verification, solved my emailing
issues, and then re-created the script in order to work well with the
new PHP 5 that I installed on my server. After...
|
by: Ben Allen |
last post by:
Hi,
Im currently getting the error:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting
T_STRING or T_VARIABLE or T_NUM_STRING in...
|
by: so many sites so little time |
last post by:
the table is head the colunm is called body
<?php //show_site.php
// This script retrieves blog entries from the database.
// Address error handing.
ini_set ('display_errors', 1);...
|
by: Anna MZ |
last post by:
I am new to php and have written the following mysql code to enter the details of a new user in the admin subdomain of my website:
$sql = "INSERT INTO 'users' ('userid', 'username', 'upassword')...
|
by: epots9 |
last post by:
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /var/www/html/xxx.php on line xxx
I get that message when i try to run my...
|
by: kestrel |
last post by:
I have some html code that is supposed to be displayed by php echo. But for some reason i keep getting a syntax error, and i cant figure out what is going on.
Heres what i have
<?php...
|
by: Phaelle |
last post by:
Parse error: parse error, expecting `T_STRING' or `T_VARIABLE' or `T_NUM_STRING'
What does that error mean? I canīt find the mistake!!
In another script, I have got another kind of mistake : parse...
|
by: jeddiki |
last post by:
Hi,
I am using the following regex to check for valid email
addresses, but I am getting errors.
if (preg_match('\^+@+\.{2,4}$\',$regex)){
echo "VALID";
}
else {
echo "INVALID";
|
by: taylorcarr |
last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: aa123db |
last post by:
Variable and constants
Use var or let for variables and const fror constants.
Var foo ='bar';
Let foo ='bar';const baz ='bar';
Functions
function $name$ ($parameters$) {
}
...
|
by: BarryA |
last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: marktang |
last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
| | |