Here's a test program that should output Members:0
but instead I get "I cannot get data from the database!".
Its as if the tables are not there but I have created them, does
anyone know why this would work on one server but not another?
<?php
function sql_get_result( $sql) {
global $link, $result;
if ( !($result = mysql_query($sq l, $link))) { exit ("I cannot get data from database!<br>") ; }
return $result;
}
include('config .php');
$link = @mysql_connect ($DB_HOST, $DB_USER, $DB_PASS) or die ('SQL Connection troubles');
mysql_select_db ($DB_DB);
$sql = "SELECT count(*) from `members` WHERE 1";
$result = sql_get_result( $sql);
$counter = mysql_fetch_row ($result);
echo "<br><b>Members : ". $counter[0];
?>
Herc
--
Pot ~ the intellectual drug :-)-~
how dangerous is 1 cigarette per week?
but instead I get "I cannot get data from the database!".
Its as if the tables are not there but I have created them, does
anyone know why this would work on one server but not another?
<?php
function sql_get_result( $sql) {
global $link, $result;
if ( !($result = mysql_query($sq l, $link))) { exit ("I cannot get data from database!<br>") ; }
return $result;
}
include('config .php');
$link = @mysql_connect ($DB_HOST, $DB_USER, $DB_PASS) or die ('SQL Connection troubles');
mysql_select_db ($DB_DB);
$sql = "SELECT count(*) from `members` WHERE 1";
$result = sql_get_result( $sql);
$counter = mysql_fetch_row ($result);
echo "<br><b>Members : ". $counter[0];
?>
Herc
--
Pot ~ the intellectual drug :-)-~
how dangerous is 1 cigarette per week?
Comment