Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 9 of 9
  1. #1
    New Coder
    Join Date
    Jun 2005
    Posts
    41
    Thanks
    3
    Thanked 0 Times in 0 Posts

    wierd connect error

    When i run a script i get this error message, havnt a clue what it means:

    Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock

    could someone please explain. thanks

  • #2
    Super Moderator guelphdad's Avatar
    Join Date
    Mar 2006
    Location
    St. Catharines, Ontario Canada
    Posts
    2,634
    Thanks
    4
    Thanked 148 Times in 139 Posts
    that message usually means that mysql server is not running.

  • #3
    New Coder
    Join Date
    Jun 2005
    Posts
    41
    Thanks
    3
    Thanked 0 Times in 0 Posts
    My server is all up and running......still this error

  • #4
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    Is it setup for php?

  • #5
    New Coder
    Join Date
    Jun 2005
    Posts
    41
    Thanks
    3
    Thanked 0 Times in 0 Posts
    yes everything even mysql......

    the mysql works perfect on other pages but on this page with a pagination its just not doing it........

  • #6
    Regular Coder
    Join Date
    Jan 2007
    Posts
    213
    Thanks
    0
    Thanked 0 Times in 0 Posts
    i presume you have the mysql_connect command in your page?
    Matthew Bagley
    Paramiliar Design Studios
    Website Design | Website Development | Search Engine Optimisation (SEO)

  • #7
    New Coder
    Join Date
    Jun 2005
    Posts
    41
    Thanks
    3
    Thanked 0 Times in 0 Posts
    ok why aint this working:

    PHP Code:
    $cato $_GET['catid'];
    if(empty(
    $cato)){
    $cato 1;
    }

    $query2 "SELECT FROM table WHERE catid='$cat' LIMIT $start, $limit";
    $result mysql_query($query2); 
    error is:

    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 'FROM table WHERE catid=6' at line 1

    mysql version: 4.0.25

  • #8
    Senior Coder Nightfire's Avatar
    Join Date
    Jun 2002
    Posts
    4,265
    Thanks
    6
    Thanked 48 Times in 48 Posts
    PHP Code:
    $query2 "SELECT field1,field2,field3,field4 FROM table WHERE catid='$cat' LIMIT $start, $limit"

  • #9
    Regular Coder
    Join Date
    Jan 2007
    Posts
    213
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by ab123 View Post
    ok why aint this working:

    PHP Code:
    $cato $_GET['catid'];
    if(empty(
    $cato)){
    $cato 1;
    }

    $query2 "SELECT FROM table WHERE catid='$cat' LIMIT $start, $limit";
    $result mysql_query($query2); 
    error is:

    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 'FROM table WHERE catid=6' at line 1

    mysql version: 4.0.25
    Simple reason you forgot to put what you are selecting, if you want to select everything then you would do
    Code:
    SELECT * FROM table
    or to select certain fields
    Code:
    SELECT field1, field2, field3 FROM table
    Matthew Bagley
    Paramiliar Design Studios
    Website Design | Website Development | Search Engine Optimisation (SEO)


  •  

    Posting Permissions

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