|
-
Jul 12th, 2003, 12:11 PM
#1
Thread Starter
Lively Member
show last ten recoreds
i wrote this code but all the time I get an error
<?
require ("admin/config.php");
mysql_connect($server,$db_user,$db_pass);
mysql_select_db($database) ;
$news=mysql_query("select * from users order by ID desc limit
0,10");
while($art = mysql_fetch_array($news)){
$name = ($art[age],1);
echo $name;
}
mysql_close();
?>
-
Jul 13th, 2003, 02:51 PM
#2
Stuck in the 80s
It'd help if you'd tell us what line you're getting the error on, but I'm going to take an educated guess:
Code:
<?
require ("admin/config.php");
mysql_connect($server,$db_user,$db_pass);
mysql_select_db($database) ;
$news = mysql_query("select * from users order by ID desc limit 0,10");
while ($art = mysql_fetch_array($news)){
$name = ($art[age], 1);
echo $name;
}
mysql_close();
?>
The line in bold just doesn't make sense. Did you leave out a function name?
And your variable naming doesn't make sense either. $news turns to $art, and $art[age] turns to $name? Whaaat?
You're also using some very bad coding practices, such as short tags and not putting the age in quotes.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|