...

View Full Version : wierd connect error



ab123
02-20-2007, 04:55 PM
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 ;)

guelphdad
02-20-2007, 06:06 PM
that message usually means that mysql server is not running.

ab123
02-20-2007, 08:21 PM
My server is all up and running......still this error

Nightfire
02-20-2007, 08:38 PM
Is it setup for php?

ab123
02-21-2007, 12:18 AM
yes everything even mysql......

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

neomaximus2k
02-21-2007, 01:03 AM
i presume you have the mysql_connect command in your page?

ab123
02-21-2007, 01:59 AM
ok why aint this working:



$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

Nightfire
02-21-2007, 02:20 AM
$query2 = "SELECT field1,field2,field3,field4 FROM table WHERE catid='$cat' LIMIT $start, $limit";

neomaximus2k
02-21-2007, 02:05 PM
ok why aint this working:



$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

SELECT * FROM table
or to select certain fields

SELECT field1, field2, field3 FROM table



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum