Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

PHP/Mysql Dreamweaver recordset page comes empty

Status
Not open for further replies.

dreamaz

Technical User
Dec 18, 2002
184
CA
Hi,

I am running the above on apache. I have multiple records in the database. I did phpinfo() and i got the php info page. When i define the recordset in my page and preview, its blank. When i remove the recordset, i get the static text, when i add the recordset everything is blank.

This is what i have so far:

<?php
mysql_select_db($database_dsa, $dsa);
$query_GetAlert = "SELECT * FROM Alerts";
$GetAlert = mysql_query($query_GetAlert, $dsa) or die(mysql_error());
$row_GetAlert = mysql_fetch_assoc($GetAlert);
$totalRows_GetAlert = mysql_num_rows($GetAlert);
?>

<span class="style1"><?php echo $row_GetAlert['AlertStatus']; ?></span><?php echo $row_GetAlert['AlertARSTT']; ?>

<?php
mysql_free_result($GetAlert);
?>

This stopped working when i upgraded the whole system to CentOS Linux v4 with the latest rpms. I have the phpMyAdmin tool which seems to work ok do administer mysql.

ANy help is apprecaited.

Thanks
 
Try the following code and let us know what happens:
Code:
<?php
// where do you connect to your database?
// $connect = mysql_connect($dbhost, $dbuser, $dbpass) or die ("Unable to connect!");
$db = mysql_select_db($database_dsa) or die("Can't select database<br>".mysql_error());
$query_GetAlert = "SELECT * FROM Alerts";
$GetAlert = mysql_query($query_GetAlert) or die(mysql_error());
$row_GetAlert = mysql_fetch_assoc($GetAlert);
echo '<pre>';print_r($row_GetAlert);echo '</pre>';
$totalRows_GetAlert = mysql_num_rows($GetAlert);
?>

Ken
 
Thanks! It was my connections/dsa.php that was mapped to the wrong file on the server even though i syncronized the site, it was not updating my connection file.

Eveyrthing works now! thanks again
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top