User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 403,398 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 4,672 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 188 | Replies: 2
Reply
Join Date: Feb 2008
Posts: 14
Reputation: niladri.user is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
niladri.user niladri.user is offline Offline
Newbie Poster

Please help me!!!!!!!

  #1  
Apr 4th, 2008
pls help me!! why this code is not executing?also send me the exact code to fetch a table from a database in a table format in a web page!!!!!

  1. <?php
  2. $con=mysql_connect("localhost","root","");
  3. mysql_select_db("niladri",$con);
  4. $sql="SELECT *
  5. FROM `category` ";
  6. $res==mysql_query($sql);
  7. while($row==mysql_fetch_array($res));
  8. {
  9. echo $row['cat_id'];
  10. echo $row['cat_name'];
  11. }
  12. ?>
Last edited by peter_budo : Apr 5th, 2008 at 12:34 pm. Reason: Keep It Organized - please use [code] tags
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Location: Bangalore, India
Posts: 3,098
Reputation: nav33n has a spectacular aura about nav33n has a spectacular aura about 
Rep Power: 8
Solved Threads: 239
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: Please help me!!!!!!!

  #2  
Apr 4th, 2008
while($row==mysql_fetch_array($res));
Remove the ; at the end.
Its $row= and not $row==.

also send me the exact code to fetch a table from a database in a table format in a web page!!!!!
You need to figure that out yourself.. Check the example here.
http://www.w3schools.com/php/php_mysql_select.asp
Last edited by nav33n : Apr 4th, 2008 at 9:44 am.
Programming today is a race between software engineers striving to build bigger and better idiot-proof programs, and the Universe trying to produce bigger and better idiots. So far, the Universe is winning.

*PM asking for help will be ignored*
Reply With Quote  
Join Date: Feb 2008
Posts: 14
Reputation: niladri.user is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
niladri.user niladri.user is offline Offline
Newbie Poster

Thanx!!!!!

  #3  
Apr 4th, 2008
Thanx nav33. I am really greateful to you!!!!!!!!!!
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Other Threads in the PHP Forum

All times are GMT -4. The time now is 9:45 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC