Jump to content

[SOLVED] Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock'


dachshund

Recommended Posts

with this

 

 


<?php

				$id=mysql_real_escape_string($_GET['id']);

				if ($id != (int)$id) {
				    echo "Invalid ID";
				} else {
    					$sql = "UPDATE content SET views=views+1 WHERE id='$id'";
    					mysql_query($sql) or die (mysql_error());


    					$sql="SELECT * FROM content WHERE id='$id'";
    					$result = mysql_query($sql) or die (mysql_error());
    					$rows=mysql_fetch_array($result);
				}

				?>

 

anyone know why this might be?

 

It smells a bit that your mysql server is not running properly or not at all or it could be permissions issue. Also if you are connecting locally tou can try changing the host you connect from localhost to 127.0.0.1

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.