URGENT HELP NEEDED WITH THIS PHP CODE

Please help me i am very new to php and mysql and i have been messing with some codes lately. i always get this two errors when i run the php code below

[b]Warning: mysql_select_db() expects parameter 2 to be resource, null given in /home/helpde82/public_html/RBS1/my_accounts_details.php on line 40

Warning: mysql_query() expects parameter 2 to be resource, null given in /home/helpde82/public_html/RBS1/my_accounts_details.php on line 42[/b]

[php]<?
//session_start();
include “authuser.php”;
?>

<?php require_once('Connections/config.php'); ?> <?php if (!function_exists("GetSQLValueString")) { function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue; $theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue); switch ($theType) { case "text": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "long": case "int": $theValue = ($theValue != "") ? intval($theValue) : "NULL"; break; case "double": $theValue = ($theValue != "") ? "'" . doubleval($theValue) . "'" : "NULL"; break; case "date": $theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL"; break; case "defined": $theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue; break; } return $theValue; } } $colname_rsInfo = "-1"; if (isset($_SESSION['user'])) { $colname_rsInfo = $_SESSION['user']; } mysql_select_db($database_config, $config); $query_rsInfo = sprintf("SELECT Firstname, Lastname, Othername, email, Account_ID, `currency`, image FROM accounts WHERE Account_ID = %s", GetSQLValueString($colname_rsInfo, "text")); $rsInfo = mysql_query($query_rsInfo, $config) or die(mysql_error()); $row_rsInfo = mysql_fetch_assoc($rsInfo); $totalRows_rsInfo = mysql_num_rows($rsInfo); $colname_rsAcct = "-1"; if (isset($_SESSION['user'])) { $colname_rsAcct = $_SESSION['user']; } mysql_select_db($database_config, $config); $query_rsAcct = sprintf("SELECT * FROM accdetail WHERE Account_ID = %s", GetSQLValueString($colname_rsAcct, "text")); $rsAcct = mysql_query($query_rsAcct, $config) or die(mysql_error()); $row_rsAcct = mysql_fetch_assoc($rsAcct); $totalRows_rsAcct = mysql_num_rows($rsAcct); ?> RBS | The Royal Bank of Scotland | Personal, Private, Business & Corporate Banking == Accounts Summary
  <tr>
    <td height="2"></td>
    <td width="32"></td>
    <td></td>
  </tr>
  
</table>    </td>
<td width="1"></td>
 

 

 

 

 



<?php echo $row_rsInfo['Account_ID']; ?>

My Account
Make transfer
PayBill
Change Profile
Send mail
 
 

 

Welcome <?php echo $row_rsInfo['Firstname']; ?> <?php echo $row_rsInfo['Othername']; ?> <?php echo $row_rsInfo['Lastname']; ?>
You are logged in as <?php echo $row_rsInfo['Account_ID']; ?>
 

Account Summary:

Account Number Account Type Account Status
Closing Balance (<?php echo $row_rsAcct['currency3']; ?>)
<?php echo $row_rsAcct['accnum']; ?>
<?php echo $row_rsAcct['acctype']; ?>
<?php echo $row_rsAcct['accstatus']; ?>
<?php echo $row_rsAcct['ledgbal']; ?>
         
   

 
Available Balance:
<?php echo $row_rsAcct['availbal']; ?> (<?php echo $row_rsAcct['currency3']; ?>)
Make transfer
 
Summary
of last transaction    
Your     Previous Transfer      
Bank Name: Bank Address Account name: Account number Amount transfered
<?php echo $row_rsAcct['bankname']; ?> <?php echo $row_rsAcct['bankaddress']; ?> <?php echo $row_rsAcct['accnametrans']; ?> <?php echo $row_rsAcct['accnumtrans']; ?> <?php echo $row_rsAcct['amounttransfer']; ?>
       
<?php echo $row_rsAcct['currency3']; ?>
         
         
Next Of Kin: <?php echo $row_rsAcct['nextofkings']; ?>

Your Email address is:<?php echo $row_rsInfo['email']; ?>
(Please note that all correspondent will be sent to this email address)
 
Operation Highlight
Exclusive Mortgage
Investment
Royal Bank of Scotland ©All right reserved
[/php]

It’s really hard to tell whats going on, I don’t see where the variable $config is declared, without that it’s going to be hard for anyone you help you…

I’m guessing it’s declared in your “Connections/config.php” file which you did post the contents to.

Sponsor our Newsletter | Privacy Policy | Terms of Service