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 423,351 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 5,218 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: 168 | Replies: 4
Reply
Join Date: Jun 2008
Posts: 123
Reputation: ishlux is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ishlux ishlux is offline Offline
Junior Poster

How to retrive the values from the database

  #1  
Jul 3rd, 2008
Hi all,
I want the the tag , to retrieve the values from the database.........









Thanks
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Nov 2007
Posts: 183
Reputation: lydia21 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 5
lydia21 lydia21 is offline Offline
Junior Poster

Re: How to retrive the values from the database

  #2  
Jul 3rd, 2008
use select query
Reply With Quote  
Join Date: Nov 2007
Posts: 183
Reputation: lydia21 is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 5
lydia21 lydia21 is offline Offline
Junior Poster

Re: How to retrive the values from the database

  #3  
Jul 3rd, 2008
$r1=mysql_query("SELECT * from tblenme where column='$id'") or die("ERROR:".mysql_error());
while($rom = mysql_fetch_row($r1))
{
echo $rom[0];//to disply first element from the fetched record
}
Reply With Quote  
Join Date: Jun 2008
Posts: 123
Reputation: ishlux is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
ishlux ishlux is offline Offline
Junior Poster

Re: How to retrive the values from the database

  #4  
Jul 3rd, 2008
Hi , I have written the code, but its giving an error,,,
Error: Could not connect to database. Please try again later.

<?php
include 'database.php';


$result = mysql_query("SELECT * FROM autoalto_contractor");

while($row = mysql_fetch_array($result))
{
echo $row['companyName'];
echo " " . $row['zipcode'];
echo " " . $row['batteryService'];
echo "<br />";
}

mysql_close();
?>
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: 240
nav33n's Avatar
nav33n nav33n is offline Offline
Posting Sensei

Re: How to retrive the values from the database

  #5  
Jul 3rd, 2008
Do you have mysql_connect and mysql_select_db in database.php ?
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  
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

Similar Threads
Other Threads in the PHP Forum

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