agine help in php

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
User avatar
forgun
Forum Commoner
Posts: 61
Joined: Wed Jan 29, 2003 6:05 am
Contact:

agine help in php

Post 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
DeGauss
Forum Contributor
Posts: 105
Joined: Tue Oct 22, 2002 9:44 am
Location: Gainesville, FL

Post by DeGauss »

Code: Select all

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

Code: Select all

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