NineChime forum

Furry stuff, oekaki stuff, and other stuff.

You are not logged in.

#1 01-19-2011 15:28:35


MySQL errors when modifying header.php

I tried to add the following into header.php:


if ($cfg['use_infractions'] == 'yes') {
    $infractions = mysql_query("SELECT * FROM {$db_mem}oekaki WHERE usrname = '$OekakiU'");
    $inf_read = mysql_fetch_array($infractions);
    $right_menu[] = $inf_read['infractions'] . ' infractions';

On the 2nd line of the code it throws out connection errors. I am wondering what I have done incorrectly?

Warning: mysql_query() [function.mysql-query]: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (2) in /home/pinkiepichu/ on line 214

Warning: mysql_query() [function.mysql-query]: A link to the server could not be established in /home/pinkiepichu/ on line 214

Also, on a minor note, is there a reason why we are using {$dm_mem} as opposed to the previous variable? Just curious. wink

Last edited by Pinkie (01-19-2011 15:30:59)


#2 01-19-2011 21:14:33


Re: MySQL errors when modifying header.php

You need to change the "mysql_" to "db_" so it's compatible with the new database layer.


if ($cfg['use_infractions'] == 'yes') {
    $infractions = db_query("SELECT * FROM {$db_mem}oekaki WHERE usrname = '$OekakiU'");
    $inf_read = db_fetch_array($infractions);
    $right_menu[] = $inf_read['infractions'] . ' infractions';

"db_mem" is a different length than "db_p", so it's easier to spot.  Previously, both database prefixes were the same length.

You can still use the old database prefixes, though, including the ancient "$OekakiPoteto_MemberPrefix".


Board footer

Yep, still running PunBB
© Copyright 2002–2008 PunBB