Jump to content


Need help with MySQL


4 replies to this topic

#1 flipk337

    Young Padawan

  • Members
  • Pip
  • 5 posts

Posted 12 November 2005 - 06:48 PM

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 '' at line 1

As for the part of the code that I believe is messing up is:

} if ($_REQUEST['m'] == "3") {
getHeader();
$result = MYSQL_QUERY("SELECT * FROM $mysql_table WHERE $id_type=$id") or die (mysql_error());
while ($mysql=mysql_fetch_array($result)) {
$mysql_values = "null&" . $mysql[news_topic] . "&" . $mysql[news_author] . "&" . $mysql[news_message];;
createJSValid($checkfields,$errors);
createForm($titles,$fields,$type,$size,$maxlength,'4',$id_type,$id,$mysql_values);
}
getFooter();

I am pretty good with PHP but the SQL part is not too great, but this works on my current web host, but was installing it on a friends site and I get this

MY MyQSL version: MySQL version 4.1.13-standard
His: MySQL version 4.0.25-standard

So possibly this is the problem? but I am willing to pay someone a few bucks if they can solve it

#2 rc69

    PHP Master PD

  • P2L Staff
  • PipPipPipPip
  • 3,827 posts
  • Gender:Male
  • Location:Here
  • Interests:Web Development

Posted 12 November 2005 - 10:12 PM

The beauty of this site is, basically everythings free, including the help, so you don't have to worry about that.
But i can also say, that's the error i hate the most, it provides no info what so ever.

So try this for your mysql_query
$result = MYSQL_QUERY("SELECT * FROM $mysql_table WHERE $id_type='$id'") or die (mysql_error());
Added single quotes around $id...

#3 _*kcdclan_*

  • Guests

Posted 13 November 2005 - 03:50 PM

assuming to your reply you dont knwo waht your doing cause thats nto what i asked any ways i figured it out.

#4 Stu

    Retired P2L Staff

  • Publishing Betazoids
  • PipPipPipPip
  • 1,761 posts
  • Gender:Male

Posted 13 November 2005 - 04:05 PM

i think you need to rethink your attitude whilst posting in these forums before you post anymore - people post help for free and if your going to reply like that you will not be finding many replies to your posts for help in the future.

a simple 'sorry i think youve misunderstood me, it is fine now' would do, as oppose to telling someone they do not know what they are doing (and in saying that about rc69 too, you are very much mistaken by the way).

i dont know if it is a misunderstanding because of the language barrier (assuming english is not your first language) or what, but next time you reply like this you will be warned.

#5 Spyder

    Jedi In Training

  • Members
  • PipPip
  • 438 posts
  • Gender:Male
  • Location:London, UK

Posted 13 November 2005 - 04:18 PM

I agree with stu kcdclan and rc69 knows what he was talking about that peice of code he was giving you was attempting to give you an error message, that explains your problem for you.

I am not a moderator and cant warn you but stu obviously is and he has every right to as rc69 helps alot of ppl including me all the time.

(and why did u reply in place of the topic poster?)

Edited by spyder, 13 November 2005 - 04:20 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users