Problem with fetching data

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
B.Murali Krishna
Forum Commoner
Posts: 28
Joined: Fri May 12, 2006 2:05 am
Location: Hyderabad,India
Contact:

Problem with fetching data

Post by B.Murali Krishna »

Hello Every One,
I have a problem of fetching database from a huge table of allmot 3500 lines, the query was't exicuted and not getting any values. Any Suggestions please tell for me.

Thanking u
Regards,
Murali
User avatar
potato
Forum Contributor
Posts: 192
Joined: Tue Mar 16, 2004 8:30 am
Location: my lovely trailer, next to the big tree

Post by potato »

what so you have already?
Any more information please...
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

Especially any errors you were getting with mysql_error().
User avatar
visonardo
Forum Contributor
Posts: 136
Joined: Mon Oct 02, 2006 7:49 pm
Location: Argentina, South America´s Sun.

Post by visonardo »

i dont know what exactly you need but here i show you a way to fetch the row´s ammount of your table.

(with mysql)

Code: Select all

$data=mysql_query('SELECT count(*) as cant FROM table',$link);
$show=mysql_fetch_assoc($data);

echo $show['cant'];
it would show you the row´s ammount that has your table. hope it be useful to you :wink:
User avatar
aaronhall
DevNet Resident
Posts: 1040
Joined: Tue Aug 13, 2002 5:10 pm
Location: Back in Phoenix, missing the microbrews
Contact:

Post by aaronhall »

A good way to troubleshoot database bugs/errors is to add mysql_error() to your queries, like such:

Code: Select all

$data=mysql_query('SELECT count(*) as cant FROM table',$link) or die(mysql_error());
Post Reply