Weird problem connecting to MySQL

Status
Not open for further replies.

tupakapoor

New Member
Messages
25
Reaction score
0
Points
0
Hi,

I get the following error when trying to connect to mysql:

Fatal error: Call to undefined function mysqli_query() in /home/kapoora/public_html/dirtybirdreport.com/functions.php on line 10

I've seen in other posts that this function works for everyone else, so I'm not sure what the problem is. Here's my code (i included the text of a required file):


Code:
$host = 'mysql.x10hosting.com';
$port = 3306;
$username = XXX;
$pwd = XXX;
$db = XXX;

function dbConnect() {
    return mysqli_connect($host, $username, $pwd, $db, $port);
}

function dbQuery($query, $DBConn) {
// line 10-->    return mysqli_query($DBConn, $query);
}

function dbClose($DBConn) {
    mysqli_close($DBConn);
}

What am I doing wrong? TIA.
 

bugfinder

Retired
Messages
2,260
Reaction score
0
Points
0
Im puzzled why you have mysqli_ why the i? perhaps this is what your problem stems from.. Im not sure the improved client is installed - you could check this of course with a phpinfo.
 

tupakapoor

New Member
Messages
25
Reaction score
0
Points
0
Im puzzled why you have mysqli_ why the i? perhaps this is what your problem stems from.. Im not sure the improved client is installed - you could check this of course with a phpinfo.
ha - trying to run phpinfo throws a server 500 error. searching the forums for mysqli_query brings up a couple posts where someone was able to successfully use mysqli. oh well, guess i'll try regular old mysql.
 

bugfinder

Retired
Messages
2,260
Reaction score
0
Points
0
Perhaps they have a different lvl of php to you - if you cant do a phpinfo, Im guessing either you have the basic one or you didnt quite type it right.

I agree try the more compatibile methods of mysql connection
 

tupakapoor

New Member
Messages
25
Reaction score
0
Points
0
sigh...switched back to regular mysql commands and now i get "Warning: mysql_connect() [function.mysql-connect]: Can't connect to local MySQL server through socket '/var/lib/mysql/mysql.sock' ". Anyone? Bueller?
 

tupakapoor

New Member
Messages
25
Reaction score
0
Points
0
btw my site is fantasycentral.x10hosting.com

not dirtybirdreport.x10hosting.com as originally reported :hsughno:
 
Last edited:

Starshine

Legend Killer
Messages
14,423
Reaction score
0
Points
0
If you are on Absolut :

http://forums.x10hosting.com/server-alerts/48486-ad-free-absolut.html

Corey said:
Well, looks like the database hard drive that we JUST GOT died.
"I apologize, but due to the amount of errors coming from the disk, it is almost definitely impossible to recover data from this drive. Even if one could recover data from this drive, the failure messages above indicate that data retrieved may be corrupted. We would recommend that your best course of action would be to have the disk replaced and then restore from any backups that you have taken.

Davy S.
SoftLayer CSA"

Problem after problem =\

We do have a backup of all the databases, I just need to figure out how we're going to fix this since they are mixed together with every other server.
 

Corey

I Break Things
Staff member
Messages
34,553
Reaction score
204
Points
63
Do you know if you ever upgraded to intermediate PHP?
 

tupakapoor

New Member
Messages
25
Reaction score
0
Points
0
Do you know if you ever upgraded to intermediate PHP?

It says my upgrade is pending on the account page. Is there something I need to do on my end to complete this?


Edit:
just to add to this thread, when I go to Fantastico from cPanel it tells me that "Fantastico is unable to connect to your MySQL server at this time. Please contact your host for assistance."

Perhaps there's a bigger problem here?
 
Last edited:

Aravinthan

New Member
Messages
68
Reaction score
0
Points
0
I am on absolut, i changed my database table, but today whe ni checked i saw that it was changed to an older version of the table, and normally this code works:
<?php


$eso = addslashes ($eso);
$email = addslashes ($email);
$country = addslashes ($country);

@ $link = mysql_pconnect ("localhost", "user", "pass");

if (!$link)
{
echo "Error: Can't connect right now. Please try again later.";
exit;
}

mysql_select_db("ara_lkaclancouncil");
$query = "insert into lkcc values
('".$id."', '".$eso."', '".$email."','".$country."')";

$result = mysql_query($query);
if ($result)
echo mysql_affected_rows()." application inserted into database. <a href='output.php'>View entries.</a>";
?>
But now it gives it nothing!!! it doesn't say any error message it stays blank. Anyone can help me?
 

GarfsField

New Member
Messages
38
Reaction score
0
Points
0
You need to also look at changing the mySql server back to localhost, since this whole issue with the down time has been due to issues there. As far as I am aware each server is again now running it's own mySql system again.
 

Aravinthan

New Member
Messages
68
Reaction score
0
Points
0
What do you mean change back to localhost? U mean in my code? or you have to do something else?
 

tupakapoor

New Member
Messages
25
Reaction score
0
Points
0
You need to also look at changing the mySql server back to localhost, since this whole issue with the down time has been due to issues there. As far as I am aware each server is again now running it's own mySql system again.

Since I first posted I have changed it back, didn't work either. There is clearly something wrong here as Fantastico can't connect to the db either, and my connection code has nothing to do with that. Yet for whatever reason its not being addressed. I would appreciate it if someone can examine this issue more closely!
Edit:
Now I get

Warning: mysql_connect() [function.mysql-connect]: Access denied for user 'kapoora'@'localhost' (using password: NO) in /home/kapoora/public_html/dirtybirdreport.com/functions.php on line 6

even though my connection is mysql_connect('localhost', $user, $pwd) where $user is 'kapoora_dirtybd' and $pwd is not null. is SQL Safe Mode turned on? it seems to be ignoring the username and pwd i'm passing in
 
Last edited:
Status
Not open for further replies.
Top