MYSQL Problem

Questions about the MySQL, PostgreSQL, and most other databases, as well as using it with PHP can be asked here.

Moderator: General Moderators

Post Reply
User avatar
Mastermind
Forum Commoner
Posts: 36
Joined: Thu Mar 10, 2005 2:38 am
Location: CDO,Philippines
Contact:

MYSQL Problem

Post by Mastermind »

Dear friends,

I will ask how to connect php program to mysql pls give me sample code



Thank you....
ody
Forum Contributor
Posts: 147
Joined: Sat Mar 27, 2004 4:42 am
Location: ManchesterUK

Post by ody »

Code: Select all

<?php

$link=mysql_connect('hostname', 'username', 'password');
mysql_select_db('database', $link);

$result=mysql_query(&quote;select col0 from tab0&quote;);
while($row=mysql_fetch_array($result)) {
 echo $row&#1111;0].&quote;<br>&quote;;
}

?>
Post Reply