Hi new to PHP...very new..I created some pages for a class I'm taking in php. Eight pages with a query and dynamic results table on each page. They all work fine but the problem is they only work locally. We have a remote server for school use, but of course when I view the query pages remotely, they display blank pages I assume because the db connection is not correct.
Is there a way to have two database connections for a single query? Is that normal in order to test locally and work remotely as well? If so hwo would I go about adding a second db connection to the same query?
Here is the connection code for my local db:
<?php require_once('Connections/student.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;
}
}
mysql_select_db($database_student, $student);
$query_Recordset1 = "SELECT tblswimwear.Model, tblswimwear.Style, tblswimwear.Color, tblswimwear.`Size`, tblswimwear.QuantityInStock FROM tblswimwear ORDER BY tblswimwear.Color, tblswimwear.`Size`DESC";
$Recordset1 = mysql_query($query_Recordset1, $student) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
Thanks for any suggestions in advance.
btw I know the remote db server location.