Jump to content


Photo

Data from a DB


  • Please log in to reply
1 reply to this topic

#1 CJLeah

CJLeah
  • New Members
  • Pip
  • Newbie
  • 8 posts

Posted 20 April 2006 - 03:23 AM

<?php 
$sql_users = mysql_query("SELECT * FROM users WHERE staff = 10, ORDER BY ID DESC LIMIT 0, 10"); 
$users = mysql_fetch_assoc($sql_users);
do {
($users['username'],("view_user?=".$users['id']),"default");
} while ($users = mysql_fetch_assoc($sql_users));  ?>

Above is the code i'm using to try and extract users that have a staff level of 10, but it's not working please help! Below is the error I get:


Parse error: parse error, unexpected ',' in /home/tmafia/public_html/staff.php on line 14

any help?




#2 Barand

Barand
  • Moderators
  • Sen . ( ile || sei )
  • 18,017 posts

Posted 20 April 2006 - 06:06 AM


$sql_users = mysql_query("SELECT * FROM users WHERE staff = 10, ORDER BY ID DESC LIMIT 0, 10");
$users = mysql_fetch_assoc($sql_users);
do {
         echo $users['username'], <br>';
} while ($users = mysql_fetch_assoc($sql_users));

what is this supposed to do
("view_user?=".$users['id']),"default")

If you are still using mysql_ functions, STOP! Use mysqli_ or PDO. The longer you leave it the more you will have to rewrite.

Donations gratefully received






moon.png

|baaGrid| easy data tables - and more
|baaChart| easy line, column and pie charts




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users