Page 1 of 1

MYSQL Problem

Posted: Mon May 16, 2005 3:49 am
by Mastermind
Dear friends,

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



Thank you....

Posted: Mon May 16, 2005 6:21 am
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;;
}

?>