Download presentation
Presentation is loading. Please wait.
Published bySilvester Pearson Modified over 9 years ago
1
Connectivity Function :- mysql_connect () mysql_select_db () mysql_query () mysql_nam_rows () mysql_fetch_row () mysql_affected_rows () mysql_fetch_array () mysql_num ()
2
syntax :- mysql_connect (servername, username, password) Example :- <?php $con=mysql_connect(‘localhost’,’root’,””); or die (mysql_error () ); echo “connection is Successfully : “; ?>
3
syntax :- Boolean Mysql_select_db(string database name, resource handler ) Example :- <?php $con=mysql_connect(‘localhost’,’root’,””); or die (mysql_error () ); Mysql_select_db(‘B.C.A.’, $con); echo “Open a Database : “; ?>
4
syntax :- Mysql_query(string query ) Example :- <?php $con=mysql_connect(‘localhost’,’root’,””); If( !$con ) { die (‘could not connect :‘.mysql_error () ); } mysql_select_db(‘test’, $con); $result=mysql_query(“select * FROM info “);
5
While ( $row=mysql_fetch_array ($result) ) { echo $row[‘first name’].” “.$row[‘last name’]; echo “ ”; } mysql_close($con); ?>
6
syntax :- Mysql_num_rows(resource handler) Example :- <?php $con=mysql_connect(‘localhost’,’root’,””); mysql_select_db(“college”, $con); $data=mysql_query(“select *from student“); $n=mysql_num_rows($data); Echo $n; ?>
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.