Jump to content


Photo

**solved** Need help with a query


  • Please log in to reply
4 replies to this topic

#1 Shadow Hatake

Shadow Hatake
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 17 March 2006 - 12:21 AM

Okay, so for a spanish extra credit project our spanish teacher asked us to create a jeaprody game. Well I decided to make mine web based and allow it to store multiple games and reuse them. Now here's my problem. I've got a query but it doesn't work. Can anyone tell what wrong with it?

Due tot he size of the query I'm posting the code on another page:
[a href=\"http://www.infected-designs.com/jeoprody/query.htm\" target=\"_blank\"]http://www.infected-designs.com/jeoprody/query.htm[/a]

#2 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 17 March 2006 - 12:35 AM

Change:

$result = mysql_query( $query );

to:

$result = mysql_query( $query ) or die(mysql_query());

Then see what the error is.

#3 Shadow Hatake

Shadow Hatake
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 17 March 2006 - 12:40 AM

[!--quoteo--][div class=\'quotetop\']QUOTE[/div][div class=\'quotemain\'][!--quotec--]You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''boardname' , 'retrievalname' , 'cat1_name' , 'cat1_q1' , 'cat1_a1' , 'cat1_q2' ' at line 1[/quote]

#4 hitman6003

hitman6003
  • Members
  • PipPipPip
  • Advanced Member
  • 1,807 posts

Posted 17 March 2006 - 12:43 AM

Don't use the single quotes around your column names. Either don't use anything and just seperate them by commas, or use backtics (`)...the one above tab on most keyboards.

#5 Shadow Hatake

Shadow Hatake
  • Members
  • PipPip
  • Member
  • 23 posts

Posted 17 March 2006 - 12:58 AM

Sweet it worked thanks. ^^




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users