close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

Confirm Page with Warning: mysql_select_db() expects parameter 2 to be resource, null

Thread began 4/10/2012 1:25 pm by ori382079 | Last modified 7/12/2018 8:55 am by Ray Borduin | 44239 views | 13 replies |

ori382079

Confirm Page with Warning: mysql_select_db() expects parameter 2 to be resource, null

Received the following error message in confirm page:
Warning: mysql_select_db() expects parameter 2 to be resource, null given in /customers/d/6/8/sapphire-wardrobes.com/httpd.www/confirm.php on line 37 Warning: mysql_query() expects parameter 2 to be resource, null given in /customers/d/6/8/sapphire-wardrobes.com/httpd.www/confirm.php on line 71

I have checked every thing possible and even compared the page with similar pages on other sites but could not identify where the problem is located. This page was previously working well and just about to tidy up and deliver it, this error starts coming up.

Please find attached the codes.

Attached Files
confirm.txt
Sign in to reply to this post

Jason ByrnesWebAssist

in the code you provide, i do not see a require once line to add the connection file that defines the connection to the database:

should look something like:
<?php require_once('Connections/sapphire_wardro.php'); ?>

Sign in to reply to this post

Pardall1955

Same Problem

I have the same problem, but it works on the localhost but not in the server on the web.

=================================================================
Warning: mysql_select_db() expects parameter 2 to be resource, null given in /home/qcc/public_html/WA_SecurityAssist/Helper_PHP.php on line 14

Warning: mysql_query() expects parameter 2 to be resource, null given in /home/qcc/public_html/WA_SecurityAssist/Helper_PHP.php on line 20
==================================================================



here is my login code:

=================

<?php require_once('Connections/connQCC1.php');?>
<?php require_once( "WA_SecurityAssist/Helper_PHP.php" ); ?>
<?php
if(isset($_POST["LogIn_x"])){
$WA_Auth_Parameter = array(
"connection" => $connQCC1,
"database" => $database_connQCC1,
"tableName" => "members",
"columns" => explode($WA_Auth_Separator,"mEmail".$WA_Auth_Separator."mPassword"),
"columnValues" => explode($WA_Auth_Separator,"".((isset($_POST["username"]))?$_POST["username"]:"") ."".$WA_Auth_Separator."".((isset($_POST["userpassword"]))?$_POST["userpassword"]:"") .""),
"columnTypes" => explode($WA_Auth_Separator,"text".$WA_Auth_Separator."text"),
"sessionColumns" => explode($WA_Auth_Separator,"mID".$WA_Auth_Separator."mUserLevel"),
"sessionNames" => explode($WA_Auth_Separator,"mID".$WA_Auth_Separator."mUserLevel"),
"successRedirect" => "A958D04I990N/a-index.php",
"failRedirect" => "EmailPW.php",
"gotoPreviousURL" => TRUE,
"keepQueryString" => TRUE
);

WA_AuthenticateUser($WA_Auth_Parameter);
}
?>

====================================================================

Sign in to reply to this post

Jason ByrnesWebAssist

before uploading to the live server, you need to update the database connection file with the correct details for connecting to the remote server.

Sign in to reply to this post

Kenny

same problem pls help

I run d same error in my live server .. here is the 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);
?>
<!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>RBS | The Royal Bank of Scotland | Personal, Private, Business &amp; Corporate Banking == Accounts Summary</title>
<style type="text/css">
<!--
body {
background-color: #FFFFFF;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
.style13 {
font-family: Arial, Helvetica, sans-serif;
font-size: 12px;
color: #FFFFFF;
}
-->
</style>
<link href="images/main.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.apps_form {background-color:#919191;
font-family:Verdana, Arial, Helvetica, sans-serif;
font-size:9pt;
text-decoration:none;
}
a:link {
color: #FF0000;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #0099CC;
}
a:hover {
text-decoration: none;
color: #FFFF00;
}
a:active {
text-decoration: none;
color: #993366;
}
.style59 {font-size: 11px}
.style59 {font-size:12px;
font-weight:bold;
}
.style60 {color: #000000}
.style60 { font-family: Arial, "Engravers MT", DilleniaUPC;
font-size: 15px;
color: #FF0000;
font-weight: bold;
}
body,td,th {
color: #000000;
}
.style66 { color: #000000;
font-style: italic;
font-weight: bold;
}
.style64 {font-family: Arial, "Engravers MT", DilleniaUPC; font-size: 12px; color: #000000; font-weight: bold; }
.style68 {
color: #FF3300;
font-weight: bold;
}
.style72 {color: #000000; font-family: "Courier New", Courier, monospace; font-size: 16; font-weight: bold; }
.style73 {font-size: 16}
.style74 {
color: #FF0000;
font-weight: bold;
}
.style75 {
color: #FF4D4D;
font-weight: bold;
}
.style76 {color: #FF0000}
.style79 {
font-size: 14px;
color: #FFFFFF;
font-style: italic;
}
.style86 {color: #003366; font-weight: bold; }
.style87 {
color: #CC3333;
font-weight: bold;
}
.style88 {
color: #CC3300;
font-weight: bold;
}
.style90 {color: #990000; font-weight: bold; font-size: 14px; font-style: italic; }
.style91 {
color: #FF3366;
font-weight: bold;
}
.style92 {
color: #990000;
font-style: italic;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_openBrWindow(theURL,winName,features) { //v2.0
window.open(theURL,winName,features);
}
//-->
</script>
</head>

<body>
<table width="1014" height="971" border="0" align="center" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr background="images/bglogo.png">
<td height="245" colspan="4" valign="top"><table width="99%" height="229" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td width="422" height="80" valign="top" bgcolor="#284B7E"><img src="images/logo.png" width="260" height="80" /></td>
<td colspan="2" align="right" valign="middle" bgcolor="#284B7E" class="style13"><!--DWLayoutEmptyCell-->&nbsp;</td>
</tr>
<tr>
<td height="147" colspan="2" valign="top"><p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p> <p>&nbsp;</p></td>
<td width="557" valign="top"><div align="right">
<p><br />
<br />
<img src="images/bann.png" width="144" height="82" /></p>
</div></td>
</tr>
<tr>
<td height="0"></td>
<td></td>
<td></td>
</tr>

<tr>
<td height="2"></td>
<td width="32"></td>
<td></td>
</tr>

</table> </td>
<td width="1"></td>
</tr>


<tr>
<td height="114" colspan="4" align="center" valign="middle"><table width="937" border="0" align="center" bgcolor="#FFFAE4">
<tr align="center" valign="middle">
<td width="133" height="85"><img src="admin/images/transfer.gif" width="67" height="67" border="0" usemap="#Map2" /></td>
<td width="133"><img src="admin/images/bp_main.gif" width="67" height="67" border="0" usemap="#Map3" /></td>
<td width="133"><img src="admin/images/em_main.gif" width="67" height="67" border="0" usemap="#Map5" />
<map name="Map5" id="Map5">
<area shape="rect" coords="2,2,64,64" href="#" onclick="MM_openBrWindow('secure_msg.php','','scrollbars=yes,width=700,height=700')" />
</map></td>
<td width="133"><img src="admin/images/upload.gif" width="67" height="67" border="0" usemap="#Map6" /></td>
<td width="172"><img src="admin/images/hp_main.gif" width="67" height="67" border="0" usemap="#Map4" /></td>
<td width="207"><img src="admin/images/ex_main.gif" width="67" height="67" border="0" usemap="#Map" /></td>
</tr>
</table> </td>
<td></td>
</tr>
<tr>
<td width="163" rowspan="3" align="center" valign="top"><p><img src="<?php echo $row_rsInfo['image']; ?>" width="118" height="135" /></p>
<p><?php echo $row_rsInfo['Account_ID']; ?></p>
<p><img src="images/myacct-my-pers-acct-pic.jpg" width="163" height="112" align="top" /></p>
<table width="161" border="0" align="center" bgcolor="#666666">
<tr>
<td height="33"><a href="my_accounts_details.php"><strong>My Account</strong></a></td>
</tr>
<tr>
<td height="41"><a href="transfer.php"><strong>Make transfer</strong></a></td>
</tr>
<tr>
<td height="39"><a href="#" onclick="MM_openBrWindow('services.php','','width=700,height=650')"><strong>PayBill</strong></a></td>
</tr>
<tr>
<td height="40"><a href="#" onclick="MM_openBrWindow('services.php','','width=700,height=650')"><strong>Change Profile</strong></a></td>
</tr>
<tr>
<td height="32"><a href="#" onclick="MM_openBrWindow('secure_msg.php','','scrollbars=yes,width=700,height=700')"><strong>Send mail</strong></a></td>
</tr>
<tr>
<td height="27">&nbsp;</td>
</tr>
<tr>
<td height="22">&nbsp;</td>
</tr>
</table> <p>&nbsp;</p></td>
<td width="559" height="35" align="center" valign="top"><div align="left">Welcome <strong><?php echo $row_rsInfo['Firstname']; ?> <?php echo $row_rsInfo['Othername']; ?> <?php echo $row_rsInfo['Lastname']; ?></strong></div></td>
<td width="281" valign="top"><div align="left">You are logged in as <span class="style92"><u><?php echo $row_rsInfo['Account_ID']; ?></u></span></div></td>
<td colspan="2" rowspan="3" align="center" valign="top"><!--DWLayoutEmptyCell-->&nbsp;</td>
</tr>
<tr>
<td height="385" colspan="2" align="center" valign="top"><div align="left">
<p><strong>Account Summary:</strong></p>
<table width="96%" height="374" align="center" cellpadding="4" cellspacing="2" bordercolor="#339999" bgcolor="#CCCCCC">
<tr bgcolor="#A4C2C2">
<th width="23%" scope="col"><span class="style59">Account Number </span></th>
<th width="19%" scope="col"><span class="style59">Account Type </span></th>
<th width="21%" scope="col"><span class="style59">Account Status </span></th>
<th colspan="2" scope="col"><div align="left"><span class="style59">Closing Balance <strong>(<span class="style91"><?php echo $row_rsAcct['currency3']; ?></span>)</strong></span></div></th>
</tr>
<tr>
<td height="53"><div align="center" class="style72"><?php echo $row_rsAcct['accnum']; ?></div></td>
<td><div align="center" class="style72"><?php echo $row_rsAcct['acctype']; ?></div></td>
<td><div align="center" class="style72"><?php echo $row_rsAcct['accstatus']; ?></div></td>
<td width="21%"><div align="center" class="style72">
<div align="center"><?php echo $row_rsAcct['ledgbal']; ?></div>
</div></td>
<td width="16%"><span class="style73"></span></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="4">&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="4"><hr /></td>
<td>&nbsp;</td>
</tr>
<tr>
<td colspan="3"><div align="right"><span class="style60"><strong>Available Balance: </strong></span></div></td>
<td><div align="center"><?php echo $row_rsAcct['availbal']; ?> (<span class="style91"><?php echo $row_rsAcct['currency3']; ?></span>)</div></td>
<td><a href="transfer.php">Make transfer </a> </td>
</tr>
<tr>
<td>&nbsp;</td><u>
<td><div align="right" class="style74"><em>Summary</em></div></td>
<td><span class="style74"><em>of last transaction</em></span></td></u>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><span class="style90">Your&nbsp;&nbsp;&nbsp;&nbsp; Previous </span></td>
<td><span class="style90">Transfer</span></td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td><span class="style86">Bank Name:</span></td>
<td><span class="style86">Bank Address</span></td>
<td><span class="style86">Account name:</span></td>
<td><span class="style86">Account number</span></td>
<td><span class="style86">Amount transfered</span></td>
</tr>
<tr>
<td><span class="style87"><?php echo $row_rsAcct['bankname']; ?></span></td>
<td><span class="style88"><?php echo $row_rsAcct['bankaddress']; ?></span></td>
<td><span class="style88"><?php echo $row_rsAcct['accnametrans']; ?></span></td>
<td><span class="style88"><?php echo $row_rsAcct['accnumtrans']; ?></span></td>
<td><span class="style88"><?php echo $row_rsAcct['amounttransfer']; ?></span></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td><div align="center" class="style91"><?php echo $row_rsAcct['currency3']; ?></div></td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
<tr>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
<td>&nbsp;</td>
</tr>
</table>
<table width="96%" border="0" align="center" bgcolor="#FF6600">
<tr>
<td height="28" align="center" class="style60"><div align="center" class="style91"><span class="headingOneGrey">Next Of Kin:</span> <span class="bodytextAprBold"><em><?php echo $row_rsAcct['nextofkings']; ?></em></span></div></td>
</tr>
</table>
<hr />
<div align="right"><span class="style64">Your Email address is</span><span class="style66">:<span class="style76"><?php echo $row_rsInfo['email']; ?></span><br />
(Please note that all correspondent will be sent to this email address)</span></div>
</div> </td>
</tr>

<tr>
<td height="188" colspan="2" valign="top"><table width="645" border="1" align="center">
<!--DWLayoutTable-->
<tr>
<td width="137" height="157"><div align="center"><img src="images/anim_graph-4.gif" width="107" height="101" /></div></td>
<td width="271"><div align="center"><img src="images/fixed_mortgage_hp030608.gif" width="271" height="141" /></div></td>
<td colspan="2" valign="top"><img src="images/investments_tab_egg-geb.gif" width="215" height="153" /></td>
<td width="18">&nbsp;</td>
</tr>
<tr>
<td height="30"><div align="center"><u><span class="style68">Operation Highlight</span></u></div></td>
<td><div align="center" class="style74"><u>Exclusive Mortgage</u></div></td>
<td width="131"><div align="center" class="style75 style76"><u>Investment</u></div></td>
<td width="78"></td>
<td></td>
</tr>
</table> </td>
</tr>
<tr>
<td height="4"></td>
<td></td>
<td></td>
<td width="11"></td>
<td></td>
</tr>
</table>
<table width="983" height="27" align="center" bgcolor="#345585">
<tr>
<td width="975" height="21"><div align="center" class="style23 style79">Royal Bank of Scotland &copy;All right reserved</div></td>
</tr>
</table>


<map name="Map" id="Map">
<area shape="rect" coords="2,2,63,62" href="logout.php" />
</map>
<map name="Map2" id="Map2"><area shape="rect" coords="0,-1,66,66" href="transfer.php" />
</map>
<map name="Map3" id="Map3"><area shape="rect" coords="-1,-2,66,67" href="#" onclick="MM_openBrWindow('services.php','','width=700,height=650')" />
</map>
<map name="Map4" id="Map4"><area shape="rect" coords="-2,-4,67,69" href="#" onclick="MM_openBrWindow('services.php','','width=700,height=650')" />
</map>
<map name="Map6" id="Map6">
<area shape="rect" coords="-4,-8,71,66" href="#" onclick="MM_openBrWindow('plain.php','','width=700,height=650')" />
</map>

ERRORS ARE

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

Sign in to reply to this post

Jason ByrnesWebAssist

the error means that the information in the Connections/config.php file for connecting to the MySQL Data base server is not correct.

you will need to edit that file and enter the correct details to connect to the MySQL server.

Sign in to reply to this post

danielsebas

Same problem

Hi Jason, I have the same problem. I checked the connections for my local server and for the live server and they are correct.

Warning: mysql_select_db() expects parameter 2 to be resource, object given in /mailformatting_php.php on line 56
Warning: mysql_query() expects parameter 2 to be resource, object given in /mailformatting_php.php on line 94

Sign in to reply to this post

Jason ByrnesWebAssist

send a copy of the page please.

Sign in to reply to this post

brendan.rehman143550

Warning: mysql_select_db() expects parameter 2 to be resource, object given

Has this issues been resolved? I thought buying these tools again would save me time, but its been a headache just to get started.

Sign in to reply to this post

Ray BorduinWebAssist

This shouldn't be an issue in the current version. If you are having problems, please attach a copy of the page you are having issues with and I'll take a look to see what it might be.

Sign in to reply to this post
Did this help? Tips are appreciated...
loading

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...