Page 1 of 1

agine help in php

Posted: Fri Jan 31, 2003 6:19 am
by forgun
hi guys i have agine prob and that time is i get the some result a very time

Code: Select all

<?php

include("includes/dbs.php");
@$lk = mysql_connect($serv,$user,$pass) or die (mysql_error());
$db = mysql_select_db($dbname,$lk);
$qur = "select * from news order by id desc limit 4";
$res = mysql_query($qur) or die (mysql_error());
while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) {
	$id = $row["id"];
	$tit = $row["title"];
}

?>
let's say the id is 1 in the dbs selection the prob is all in the 4 times i get the data in the id 1 in the selection
how i can fix that

Posted: Fri Jan 31, 2003 6:23 am
by DeGauss

Code: Select all

while ($row = mysql_fetch_array($res,MYSQL_ASSOC)) &#123;

Code: Select all

while ($row = mysql_fetch_array($res)) &#123;
?