/    Sign up×
Community /Pin to ProfileBookmark

Dreamweaver Testing to Remote

Hi I am trying to take my files from Testing on Dreamweaver CS5 to Remote. I can transfer the files no problem but when I try to view the pages live it get the following error message. (I can connect to the database successfully) (…..) for safety I have the actual information.

Connected successfully
Warning: mysql_select_db(): supplied argument is not a valid MySQL-Link resource in /hermes/web05/b1750/………..s/………../………./index.php on line 43

Warning: mysql_query(): supplied argument is not a valid MySQL-Link resource in /hermes/web05/b1750/………./……../………/index.php on line 46

I have the following code. Any Help is much appreciated.

<?php require_once(‘Connections/Matttest.php’); ?>
<?php
if (!function_exists(“GetSQLValueString”)) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = “”, $theNotDefinedValue = “”)
{
if (PHP_VERSION < 6) {
$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;
}
}

$currentPage = $_SERVER[“PHP_SELF”];

$maxRows_threedglasses = 4;
$pageNum_threedglasses = 0;
if (isset($_GET[‘pageNum_threedglasses’])) {
$pageNum_threedglasses = $_
GET[‘pageNum_threedglasses’];
}
$startRow_threedglasses = $pageNum_threedglasses * $maxRows_threedglasses;

mysql_select_db($database_Matttest, $Matttest);
$query_threedglasses = “SELECT * FROM sheet2 WHERE category = ‘3D Viewing Glasses’ ORDER BY price DESC”;
$query_limit_threedglasses = sprintf(“%s LIMIT %d, %d”, $query_threedglasses, $startRow_threedglasses, $maxRows_threedglasses);
$threedglasses = mysql_query($query_limit_threedglasses, $Matttest) or die(mysql_error());
$row_threedglasses = mysql_fetch_assoc($threedglasses);

if (isset($_GET[‘totalRows_threedglasses’])) {
$totalRows_threedglasses = $_
GET[‘totalRows_threedglasses’];
} else {
$all_threedglasses = mysql_query($query_threedglasses);
$totalRows_threedglasses = mysql_num_rows($all_threedglasses);
}
$totalPages_threedglasses = ceil($totalRows_threedglasses/$maxRows_threedglasses)-1;

$queryString_threedglasses = “”;
if (!empty($_SERVER[‘QUERY_STRING’])) {
$params = explode(“&”, $_
SERVER[‘QUERY_STRING’]);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, “pageNum_threedglasses”) == false &&
stristr($param, “totalRows_threedglasses”) == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_threedglasses = “&” . htmlentities(implode(“&”, $newParams));
}
}
$queryString_threedglasses = sprintf(“&totalRows_threedglasses=%d%s”, $totalRows_threedglasses, $queryString_threedglasses);
?>
<!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=utf-8″ />
<title>Untitled Document</title>
<style type=”text/css”>
@import url(“CSS/masterdetail.css”);
@import url(“CSS/main.css”);
</style>
</head>

<body>
<div id=”wrapper”>
<div id=”Header”><img src=”header.jpg” alt=”” width=”946″ height=”158″ /></div>
<div id=”Specials”><img src=”specialbanner.jpg” alt=”” width=”660″ height=”111″ align=”middle” /></div>
<div id=”leftbar”>
<p>Content for id &quot;leftbar&quot; Goes Here</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
</div>
<div id=”Mheader”>
<table cellspacing=”0″ cellpadding=”0″>
<tr>
<td width=”244″>3D Viewing Glasses</td>
</tr>
</table>
</div>
<div id=”Content”>
<p>&nbsp;
<br />
<table border=”0″>
<tr>
<td><?php if ($pageNum_threedglasses > 0) { // Show if not first page ?>
<a href=”<?php printf(“%s?pageNum_threedglasses=%d%s”, $currentPage, 0, $queryString_threedglasses); ?>”>First</a>
<?php } // Show if not first page ?></td>
<td><?php if ($pageNum_threedglasses > 0) { // Show if not first page ?>
<a href=”<?php printf(“%s?pageNum_threedglasses=%d%s”, $currentPage, max(0, $pageNum_threedglasses – 1), $queryString_threedglasses); ?>”>Previous</a>
<?php } // Show if not first page ?></td>
<td><?php if ($pageNum_threedglasses < $totalPages_threedglasses) { // Show if not last page ?>
<a href=”<?php printf(“%s?pageNum_threedglasses=%d%s”, $currentPage, min($totalPages_threedglasses, $pageNum_threedglasses + 1), $queryString_threedglasses); ?>”>Next</a>
<?php } // Show if not last page ?></td>
<td><?php if ($pageNum_threedglasses < $totalPages_threedglasses) { // Show if not last page ?>
<a href=”<?php printf(“%s?pageNum_threedglasses=%d%s”, $currentPage, $totalPages_threedglasses, $queryString_threedglasses); ?>”>Last</a>
<?php } // Show if not last page ?></td>
</tr>
</table>
<p>Records <?php echo ($startRow_threedglasses + 1) ?> to <?php echo min($startRow_threedglasses + $maxRows_threedglasses, $totalRows_threedglasses) ?> of <?php echo $totalRows_threedglasses ?> </p>
</p>
<p>&nbsp; </p>
<table >
<tr>
<?php
$threedglasses_endRow = 0;
$threedglasses_columns = 2; // number of columns
$threedglasses_hloopRow1 = 0; // first row flag
do {
if($threedglasses_endRow == 0 && $threedglasses_hloopRow1++ != 0) echo “<tr>”;
?>
<td><div class=”Masterdivs” id=”Masterdivs”>
<div class=”Masterheadline” id=”Masterheadline”><a href=”3d_glasses_details.php?recordID=<?php echo $row_threedglasses[‘headline’]; ?>”><?php echo $row_threedglasses[‘headline’]; ?>&nbsp;</a></div>
<div id=”Masterpicture”><?php echo $row_threedglasses[‘main_image’]; ?></div>
<div class=”Masterdetails” id=”Masterdetails”>
<p><?php echo $row_threedglasses[‘packing_slip_desc’]; ?>&nbsp;</p>
<div class=”Masterprice” id=”Masterprice”><?php echo $row_threedglasses[‘price’]; ?></div>
<p>&nbsp;</p>
</div>
<p>&nbsp;</p>
</div></td>
<?php $threedglasses_endRow++;
if($threedglasses_endRow >= $threedglasses_columns) {
?>
</tr>
<?php
$threedglasses_endRow = 0;
}
} while ($row_threedglasses = mysql_fetch_assoc($threedglasses));
if($threedglasses_endRow != 0) {
while ($threedglasses_endRow < $threedglasses_columns) {
echo(“<td>&nbsp;</td>”);
$threedglasses_endRow++;
}
echo(“</tr>”);
}?>
</table>
<p>&nbsp;</p>
</div>
<div id=”footer”>
<p>&copy; Copyright of Highland SuperStores 2011<br />
<a href=”www.emmasgraphics.net”>Created by Emma’s Graphic Design of <br />
Fort Worth TX</a></p>
</div>
</div>
</body>
</html>
<?php
mysql_free_result($threedglasses);
?>

to post a comment
PHP

1 Comments(s)

Copy linkTweet thisAlerts:
@shutterbugauthorFeb 25.2011 — Case Closed
×

Success!

Help @shutterbug spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 6.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @nearjob,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...