arc2002
02-03-2005, 09:53 AM
Hi there,
I have a little problem I would really appreciate some help.
I have an SQL database, which looks like this;
ID - News
1 - News item 1
2 - News item 2
And I am trying to display them on a page, using echo. However what i am trying to do is to display them individually, eg echo id=2 in one place on the page, then echo id=1 somewhere else. I am really not too sure how to do this!
I will post the PHP code;
<?php
mysql_select_db($database_wiserhosting, $wiserhosting);
$query_Recordset1 = "SELECT * FROM database WHERE id = 1";
$Recordset1 = mysql_query($query_Recordset1, $wiserhosting) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<?php echo $row_Recordset1['news']; ?>
<?php
mysql_free_result($Recordset1);
?>
However my problem is this code simply displays record 1, and was wondering if the only way to do it is to create another recordset?
Would appreciate any help Cheers Bob.
I have a little problem I would really appreciate some help.
I have an SQL database, which looks like this;
ID - News
1 - News item 1
2 - News item 2
And I am trying to display them on a page, using echo. However what i am trying to do is to display them individually, eg echo id=2 in one place on the page, then echo id=1 somewhere else. I am really not too sure how to do this!
I will post the PHP code;
<?php
mysql_select_db($database_wiserhosting, $wiserhosting);
$query_Recordset1 = "SELECT * FROM database WHERE id = 1";
$Recordset1 = mysql_query($query_Recordset1, $wiserhosting) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
?>
<?php echo $row_Recordset1['news']; ?>
<?php
mysql_free_result($Recordset1);
?>
However my problem is this code simply displays record 1, and was wondering if the only way to do it is to create another recordset?
Would appreciate any help Cheers Bob.