Members Login.
 

Please register HERE to be part of our Community
Contest of the Day.
 
Current Promotions.
 
Earn By Posting
 
Participate in forum and Earn $$$.
  • Referrer Credit - BRL$ 100
  • Positive Rep Cr. - BRL$ 3
  • New Thread Cr.- BRL$ 3
  • Posting Cr. - BRL$ 2
  • Post size Credit
Full List of BRL$ Earnings
Sponsors.
 


mySQL Database Discussion related to mySQL database, mySQL queries, mySQL Commands, mySQL tutorials...

Reply
  #1 (permalink)  
Old 10-02-2007
Senior Member
 
Join Date: Jun 2007
Posts: 1,413
BRL$: 4,361.66
Rep Power: 168
mr_atom is on a distinguished roadmr_atom is on a distinguished road
Default MySQL General: Retrieving Data from a table

Hi I have a database called CARS within it is a table called FORD which contains a field called SPEED. All I want to do is write some simple php code to retrieve the first entry in the field SPEED and print it to the screen. Can anyone help? I a

More...
__________________

To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


To view links or images in signatures your post count must be 10 or greater. You currently have 0 posts.


Current Promotions... Post a New Thread anywhere on Search Engine Optimization Board and earn BRL$ 5 for every thread.
Important - Read before posting Please carefully read the Global Rules and Posting Rules for GPT / Buy - Sell Offers / Link Exchange sections before posting.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-19-2008
Jr. Member
 
Join Date: Apr 2008
Location: California
Posts: 155
BRL$: 161.29
Rep Power: 21
binary8383 is on a distinguished road
Smile Re: MySQL General: Retrieving Data from a table

hope this help

<?php

$conn = mysql_connect("localhost", "*****", "**********");
mysql_select_db("car");

$sql = "select speed from ford limit 1";

$res = mysql_query($sql, $conn) or die(mysql_error());

if($res && mysql_num_rows($res))
{
while ($rows = mysql_fetch_array($res))
{
echo "speed is ".$rows['speed'];
}

}

mysql_free_result($res);
?>


Current Promotions... Post a New Thread anywhere on Search Engine Optimization Board and earn BRL$ 5 for every thread.
Important - Read before posting Please carefully read the Global Rules and Posting Rules for GPT / Buy - Sell Offers / Link Exchange sections before posting.
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
MySQL General: mysql tables lost after changing the mysql management node mr_atom mySQL Database 0 09-19-2007 01:21 AM
All Managed – All the time. Great Deals! Rss_Feeds Dedicated Server Offers 0 09-14-2007 07:43 PM
MySQL General: PHP/MySQL - searching for string in table mr_atom mySQL Database 0 07-23-2007 11:15 PM
MySQL General: problem with create table statement mr_atom mySQL Database 0 07-09-2007 06:03 AM
MySQL General: Help: Unable to start MySQL in linux mr_atom mySQL Database 0 07-09-2007 06:03 AM


 

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95