Faqts : Computers : Programming : Languages : PHP

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

21 of 27 people (78%) answered Yes
Recently 6 of 10 people (60%) answered Yes

Entry

Mysql: fetch and print the value of a single cell

Jul 5th, 2002 15:39
Matt Rudderham, mr fitz,


Connect to the Mysql Server and select the database:
$db = mysql_connect("localhost", "User", "Password");
   mysql_select_db("DatabaseName",$db);
Run a query:
$SQL="SELECT * FROM MEMBERS";
$RESULT=mysql_query($SQL);
-->Get the result:
$myrow=mysql_fetch_array($RESULT);
Display it:
echo $myrow["Cellname"];
-->
Put the stuff in between the --> to display all the results if multiple.
- Matt