lomokev
11-12-2004, 03:39 AM
i know that my Sql query will only return one result so is there a better way to to print one row that doing the while way?
also what would be the essayist way of finding the 'id' of the recored before and after this one where section = 'gagsandstrips' with out doing some kind of loop?
<?php
require_once('inc/db_connect_inc.php');
$sql = "SELECT * FROM work WHERE section = 'gagsandstrips' AND id = 23;";
$rs = mysql_query($sql);
while($row = mysql_fetch_assoc($rs)){
echo $row['id'] . " " . $row['tittle'] ;
}
?>
also what would be the essayist way of finding the 'id' of the recored before and after this one where section = 'gagsandstrips' with out doing some kind of loop?
<?php
require_once('inc/db_connect_inc.php');
$sql = "SELECT * FROM work WHERE section = 'gagsandstrips' AND id = 23;";
$rs = mysql_query($sql);
while($row = mysql_fetch_assoc($rs)){
echo $row['id'] . " " . $row['tittle'] ;
}
?>