LinuxQuestions.org
LinuxAnswers - the LQ Linux tutorial section.
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 05-07-2012, 10:26 AM   #1
shygvy
LQ Newbie
 
Registered: May 2012
Posts: 10

Rep: Reputation: Disabled
Exclamation i am trying to write a php program n ends up giving me parse error on line 21


Parse error: parse error in C:\xampp\htdocs\corp\shared\function.php on line 21
function get_pages_for_subject($subject_id){
$query ="SELECT*
FROM pages WHERE subject_id = {$subject_id};
ORDER by position ASC";
$page_set = mysql_query($query);
confirm_query($page_set);
return $pages_set;
}
ma line 21 is function get_pages_for_subject($subject_id){
 
Old 05-07-2012, 11:24 AM   #2
klurik
LQ Newbie
 
Registered: Feb 2012
Location: Russia
Distribution: Debian 6
Posts: 15

Rep: Reputation: 1
Try remove semicolon before ORDER?
 
1 members found this post helpful.
Old 05-08-2012, 07:48 AM   #3
shygvy
LQ Newbie
 
Registered: May 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
Thumbs up thanx

it worked
 
Old 05-08-2012, 04:35 PM   #4
klurik
LQ Newbie
 
Registered: Feb 2012
Location: Russia
Distribution: Debian 6
Posts: 15

Rep: Reputation: 1
Thats great
 
Old 05-09-2012, 07:49 AM   #5
shygvy
LQ Newbie
 
Registered: May 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\content.php on line 40

while($page = mysql_fetch_array($page_set)){
echo "<li";
if ($page ["id"]==$sel_page){
echo "class=\"selected\"";
}
echo"><a href=\"content.php? page=" . urlencode($page["id"]).
"\">{$pages["name"]}</a></li>";
}

this is my line 40
 
Old 05-09-2012, 09:32 AM   #6
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Colombia
Distribution: Kubuntu, Debian, Knoppix
Posts: 1,982
Blog Entries: 1

Rep: Reputation: 83
How are you setting $page_set? Cause you are returning it so you must be saving it somewhere, right?
 
1 members found this post helpful.
Old 05-09-2012, 11:11 AM   #7
shygvy
LQ Newbie
 
Registered: May 2012
Posts: 10

Original Poster
Rep: Reputation: Disabled
eantoranz

you are heaven sent...thanks a million.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
mod_gnutls giving me a parse error with a key from a CA. mtlhd Linux - Security 3 07-08-2010 03:39 PM
Parse error: syntax error (install_admin_menu.php line 2) mike24078 Programming 10 04-08-2010 09:34 AM
What's the meaning of "PHP Parse error: parse error, unexpected $ in..." frandalla Programming 23 03-04-2009 01:34 PM
PHP Error Parse error: parse error, unexpected $ in /home/content/S/k/i/SkinCare4U/h CowanServices Programming 2 12-09-2008 09:26 PM


All times are GMT -5. The time now is 05:00 AM.

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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration