GIDForums  

Go Back   GIDForums > Computer Programming Forums > MySQL / PHP Forum
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

 
 
Thread Tools Search this Thread Rate Thread
  #1  
Old 14-Nov-2006, 21:38
ctrohaya ctrohaya is offline
New Member
 
Join Date: Nov 2006
Posts: 29
ctrohaya is on a distinguished road

mysql error


this is my script:
$query1 = "SELECT count(*) FROM result WHERE class = '$Class' AND subjects='English' AND matrics IN ("SELECT matric FROM student WHERE course= '$f_kursus'")";
when i run, this error is appear:
Parse error: syntax error, unexpected T_STRING in c:\wamp\www\ikm\papar.php on line 34
whereas line 34 refer to the above script.
could anyone tell me where is the error............
  #2  
Old 16-Nov-2006, 07:01
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,140
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: mysql error


Looks like there are extra double-quotes -- around the subquery.
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #3  
Old 17-Nov-2006, 21:42
ctrohaya ctrohaya is offline
New Member
 
Join Date: Nov 2006
Posts: 29
ctrohaya is on a distinguished road

Re: mysql error


oh yes! i've found it. but it still didn't work because apache server i'm using is doesn't support nested query. so, does anyone know what else alternative that can produce the same output instead of above nested query?
  #4  
Old 18-Nov-2006, 20:51
TurboPT's Avatar
TurboPT TurboPT is offline
Senior Member
 
Join Date: Feb 2006
Location: Atlanta, GA
Posts: 1,140
TurboPT is a jewel in the roughTurboPT is a jewel in the roughTurboPT is a jewel in the rough

Re: mysql error


Quote:
Originally Posted by ctrohaya
... but it still didn't work because apache server i'm using is doesn't support nested query...
I don't think apache cares whether there is a nested query (or not), that typically depends on the backend database. What DB do you use? If it is mysql, what is the version?
__________________
Use the force...read the source!!
WYCIWYG -- what you code is what you get!
  #5  
Old 22-Nov-2006, 20:23
ctrohaya ctrohaya is offline
New Member
 
Join Date: Nov 2006
Posts: 29
ctrohaya is on a distinguished road

Re: mysql error


i'm using mysql v 4.something. but, that query has been settled. i've convert it to 2 single query. now, i have another one query that i failed to convert it. it already four days i worked for it, but i got no solution.

query=SELECT * FROM student WHERE course = 'TKK' AND matric NOT IN (SELECT matrics FROM result WHERE subject = 'mathemathics')
 
 

Recent GIDBlogProblems with the Navy (Chiefs) by crystalattice

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Rate This Thread
Rate This Thread:

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Tutorial] GUI programming with FLTK dsmith FLTK Forum 10 03-Oct-2005 16:41
Winsock error when compiling FLTK 2.0 Projects mauriciorossi FLTK Forum 3 16-Aug-2005 11:18
Help with syntax errors PeteGallo C Programming Language 7 08-Aug-2005 21:30
What is "Ambigious symbol" ??*( a compilation error) small_ticket C++ Forum 2 07-Jan-2005 22:10
Can enum have same name as class? crystalattice C++ Forum 3 08-Dec-2004 17:43

Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The

All times are GMT -6. The time now is 06:26.


vBulletin, Copyright © 2000 - 2009, Jelsoft Enterprises Ltd.