Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / New
Stats: 3,158,303 members, 7,836,315 topics. Date: Wednesday, 22 May 2024 at 04:35 AM

How To Select All The Fields From A Mysql Table And Access The Data Individually - Webmasters - Nairaland

Nairaland Forum / Science/Technology / Webmasters / How To Select All The Fields From A Mysql Table And Access The Data Individually (638 Views)

Help On Granting A Mysql Database Access Through Remote Connections / Help! Backup A Mysql Database Using Php / Loading Flash Movies Into A Mysql Database (2) (3) (4)

(1) (Reply)

How To Select All The Fields From A Mysql Table And Access The Data Individually by oksoftmarketing: 1:48pm On Oct 17, 2012
You can access all the data from a mysql table and access the data individually using php.

First you have to connect to the database server with this function
<? Php
$link= mysql_connect("host server", "user name", "password"wink;

then select data base
$db = mysql_select_db("data base name", $link);

now write the sql query
$sql= "select * from tablename";
$query= mysql_query($sql, $link );

this is where you manipulate the data

while($bb= mysql_fetch_array($query)){
$ab[]= $bb["column name"];
}

?>

this will put all the rows of that column into the array $ab[] and u can access them individually eg. $ab[0] holds the first value and so on.

Visit www.oksoftmarketing..com for more sample codes.

(1) (Reply)

What Do You Dislike About My Site? / Syskay Is Back!!!!!!!!!!!! / Where In Lagos Can I Learn A Professional Web Design

(Go Up)

Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health
religion celebs tv-movies music-radio literature webmasters programming techmarket

Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10)

Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 5
Disclaimer: Every Nairaland member is solely responsible for anything that he/she posts or uploads on Nairaland.