I'm usually using ColdFusion and am still a bit shaky with my php. Hope somebody can help me with this.
I have a MySql DB and there are two sets of data in there, but when try to retrieve the data, I get no results. The data would be used to create the layout dynamically. So the site loads (no error messages on the 'or die' comands, so connection to the DB should work), but the CSS functionality doesn't work.
I tried a var_dump, this is the outcome:
NULL resource(4) of type (mysql result) NULL NULL NULL NULL
This is the code I have (the connectivity data is excluded here...). Does anybody see an error on this?
Code: Select all
<?
$JapWholesaleDB = mysql_pconnect($hostname_JapWholesaleDB, $username_JapWholesaleDB, $password_JapWholesaleDB) or trigger_error(mysql_error(),E_USER_ERROR);
mysql_connect($hostname_JapWholesaleDB, $username_JapWholesaleDB, $password_JapWholesaleDB)
or die( "Error! Could not connect to database: " . mysql_error() );
mysql_select_db($database_JapWholesaleDB)
or die( "Error! Could not select the database: " . mysql_error() );
$query = mysql_query("SELECT * FROM jap_page_templates");
var_dump($row_query );
var_dump($query );
while ($row_query = mysql_fetch_object($query))
{
$colour_primary = $row['temp_col_primary'];
$colour_nav = $row['temp_col_secondary'];
$temp_image = $row['temp_image'];
$temp_status = $row['$temp_status'];
}
var_dump($colour_primary);
var_dump($colour_nav);
var_dump($temp_image);
var_dump($temp_status);
include("inc_css.css");
mysql_close(); ?>Adrian