Advanced search  

News:

cpg1.5.48 Security release - upgrade mandatory!
The Coppermine development team is releasing a security update for Coppermine in order to counter a recently discovered vulnerability. It is important that all users who run version cpg1.5.46 or older update to this latest version as soon as possible.
[more]

Pages: [1]   Go Down

Author Topic: DB Connection error.  (Read 3514 times)

0 Members and 1 Guest are viewing this topic.

mixmasterhank

  • Coppermine newbie
  • Offline Offline
  • Posts: 12
DB Connection error.
« on: August 03, 2004, 12:11:49 pm »

I am trying to connect to my imgal users DB from an outsite page with the following code to print out the username using the cookie and the cpgd11_users table with the following code:

Code: [Select]
<?php
$dbhost 
'localhost';
$dbusername ####;
$dbpasswd ####;
$database_name ####;
$uid $_COOKIE['cpg11d_uid'];

$db mysql_connect("$dbhost""$dbusername""$dbpasswd");
mysql_select_db("$database_name"$db);

$select mysql_query("SELECT * FROM cpg11d_users WHERE user_id = $uid"); 
while ($cnt mysql_fetch_array($select)){
$destname $cnt[user_name];
}
echo "$destname";
mysql_free_result($select);
exit();

?>

However everytime I do this I get the errors:
Quote
Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /home/destinat/public_html/things.php on line 12

Warning: mysql_free_result(): supplied argument is not a valid MySQL result resource in /home/destinat/public_html/things.php on line 16

It was working fine and then all of a sudden it messed up.. Anyone see anything wrong with it?
Logged
Pages: [1]   Go Up
 

Page created in 0.016 seconds with 15 queries.