From 57df7bc3961d1226724b46e2317dcae770d4403b Mon Sep 17 00:00:00 2001 From: Gabor Hojtsy Date: Sat, 17 Nov 2001 11:31:21 +0000 Subject: [PATCH] More correct example, applying PEAR code standars, and using CDATA to ease the work of manual people ;) git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@62630 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/mysql.xml | 52 ++++++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 24 deletions(-) diff --git a/functions/mysql.xml b/functions/mysql.xml index 87bcbba6b0..2db8f5f072 100644 --- a/functions/mysql.xml +++ b/functions/mysql.xml @@ -1,5 +1,5 @@ - + MySQL Functions MySQL @@ -32,31 +32,35 @@ MySQL extension overview example -<?php - $link = mysql_connect("mysql_host", "mysql_login", "mysql_password") - or die ("Could not connect"); - print ("Connected successfully"); - mysql_select_db ("my_database") - or die ("Could not select database"); - - $query = "SELECT * FROM my_table"; - $result = mysql_query ($query) - or die ("Query failed"); +\n"; +while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { + print "\t\n"; + foreach ($line as $col_name => $col_value) { + print "\t\t$col_name$col_value\n"; + } + print "\t\n"; +} +print "\n"; + +// Closing connection +mysql_close($link); +?> +]]>