SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Evangelist
    Join Date
    Mar 2011
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    MySQL Server Version error. PHP code problem.

    What does this error mean?

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


    what does near 'sql' mean?

    It also says at line 1.

    Line 1 just has <?php

    Any ideas?

  2. #2
    Twitter: @AnthonySterling silver trophy AnthonySterling's Avatar
    Join Date
    Apr 2008
    Location
    North-East, UK.
    Posts
    6,111
    Mentioned
    3 Post(s)
    Tagged
    0 Thread(s)
    That's a message from your MySQL server, the line 1 it is indicating is line 1 of the SQL query you sent it.
    @AnthonySterling: I'm a PHP developer, a consultant for oopnorth.com and the organiser of @phpne, a PHP User Group covering the North-East of England.

  3. #3
    SitePoint Evangelist
    Join Date
    Mar 2011
    Posts
    418
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    so you are saying it does not like

    PHP Code:
    @mysql_query("insert into products(name, price) values($name$price)");
        
        
        
    $sql "INSERT INTO products VALUES (null, '$name', '$price')"
    i thought it might understand one of them so i included both lines of code.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •