Forums

PHP

This topic is locked

More than one recordset on a page!

Posted 05 Jun 2007 16:45:45
1
has voted
05 Jun 2007 16:45:45 rusoul shahin posted:
Hi,

This problem is a simplier problem to a guy that has posted a few days ago.

I'm creating a site which the detail page uses URL variable. So i have the main recordset working fine when on its own it loads up the images on the page depending on the variable. I need to introduce another recordset however to also go with that variable but a main description for each variable.

The problem is when i add another recordset (query) in dreamweaver all it creates is a blank white page. As soon as i take away that recordset and have the first one only it works perfectly. Can anyone help me please!!!

my php code for the recordsets together is:


<?php require_once('Connections/cakes.php'); ?>

<?php
$colname_rsCakes = "1";
if (isset($_GET['category'])) {
$colname_rsCakes = (get_magic_quotes_gpc()) ? $_GET['category'] : addslashes($_GET['category']);
}
mysql_select_db($database_cakes, $cakes);
$query_rsCakes = sprintf("SELECT * FROM cakes WHERE category = '%s'", $colname_rsCakes);
$rsCakes = mysql_query($query_rsCakes, $cakes) or die(mysql_error());
$row_rsCakes = mysql_fetch_assoc($rsCakes);
$totalRows_rsCakes = mysql_num_rows($rsCakes);

$colname_rsDesc = "1";
if (isset($_GET['category'])) {
$colname_rsDesc = (get_magic_quotes_gpc()) ? $_GET['category'] : addslashes($_GET['category']);
}
mysql_select_db($database_cakes, $cakes);
$query_rsDesc = sprintf("SELECT * FROM descriptions WHERE category = '%s'", $colname_rsDesc);
$rsDesc = mysql_query($query_rsDesc, $cakes) or die(mysql_error());
$row_rsDesc = mysql_fetch_assoc($rsDesc);
$totalRows_rsDesc = mysql_num_rows($rsDesc);
?>

Replies

Replied 05 Jun 2007 17:02:10
05 Jun 2007 17:02:10 rusoul shahin replied:
NO Sweat! For some strange reason its started working how i wanted it to! i don't even know what ive done!

Thanks to anyone who does read this though. No doubt i will be posting on here again soon as im not that great with mysql stuff at the moment!

Cheers

Replied 10 Jul 2007 12:09:13
10 Jul 2007 12:09:13 Steve Fuller replied:
Hi! Just so you know, it has been my experience that php will generate a blank white page because it has encountered some sort of syntax error. This being said, I have found a special character (like a missing semicolon from the end of a statement) that's out of place to be the culprit most of the time.

Reply to this topic