Jump to content

Error trying to connect 2 db's


thefreebielife

Recommended Posts

i have never done this before so i didnt know where to begin


<? session_start(); ?>
<? require("config.php"); require("functions.php"); admin(); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1" />
<title>Untitled Document</title>
</head>

<?php
$sql = mysql_connect('mysql.powweb.com', 'cash1', 'cash');
if (!$sql) {
    die('Could not connect: ' . mysql_error());
?>

<table style="border:1px solid #0099CC; width:735px; font-size:12px; margin-left:30px;" cellpadding="2" cellspacing="0">
        <tr>
        <td colspan="3" style="border-bottom:1px solid #0099CC"><div align="center"><strong>Your Manual Credit Requests </strong></div></td>
        </tr>
        <tr bgcolor="#CCEAEA">
        <td width="25%" style="border-bottom:1px solid #0099CC"><div align="center">uId </div></td>
        <td width="50%" style="border-bottom:1px solid #0099CC"><div align="center">Name</div></td>
        <td width="25%" style="border-bottom:1px solid #0099CC"><div align="center">email</div></td>
        </tr>

        <?   
        $sql = SELECT username FROM cash1.users WHERE uId = "" SELECT username FROM a100.users WHERE uId = "" . "'order by uId DESC, username DESC";
        $result = mysql_query($sql) or die(mysql_error());
        $i=0;
        while($r=mysql_fetch_array($result))
        {       
                $i=$i+1;
                ?>
                <tr bgcolor="#<?= ($i++%2) ? 'FFFFFF' : 'F5F5F5' ?>">
                <td width="25%" style="border-bottom:1px dashed orange; border-right:1px dashed orange"><div align="center"><FONT SIZE="2"><? echo $r["uId"]; ?></FONT></div></td>
                <td width="50%" style="border-bottom:1px dashed orange; border-right:1px dashed orange"><div align="left"><FONT SIZE="2"> <? echo $r["username"]; ?></FONT></div></td>
                <td width="25%" style="border-bottom:1px dashed orange; border-right:1px dashed orange"><div align="center"><FONT SIZE="2"><? echo $r["email"]; ?></FONT></div></td>
                </tr> 
                <? }
        if($i==0)
        {
                ?>
                <tr>
                <Td colspan=3 align="center"><FONT SIZE="2" COLOR="#FF0000"><B>There are no manual credit requests submitted.</B></FONT></Td>
                </tr>

                <? } ?>


        </table>       

<body>
</body>
</html>

 

 

But now im getting these 2 errors:

/hermes/web10/b257/pow.thefreebielife/cash/htdocs/test1.php on line 24

PHP Warning: mysql_connect() [<a href='function.mysql-connect'>function.mysql-connect</a>]: Access denied for user 'freebie'@'cgi1502.int.bizland.net' (using password: YES) in /hermes/web10/b257/pow.thefreebielife/htdocs/config.php on line 6

 

 

The second one is most confusing since im not even using the "freebie" login anymore

Link to comment
https://forums.phpfreaks.com/topic/55005-error-trying-to-connect-2-dbs/
Share on other sites

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.