note 68549 deleted from function.mysql-fetch-row by bjori

From: Date: Wed, 02 Aug 2006 12:57:59 +0000
Subject: note 68549 deleted from function.mysql-fetch-row by bjori
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-115458@lists.php.net to get a copy of this message
Note Submitter: rakh at dangerclan dot net Reason: useless ---- This took me a little time to find out, so I'm sharing it :) if you do something like this: <?php // needed data $server = 'anyserver'; $username = 'aniceusername'; $password = 'ihopenotsoeasy' $database = 'clients'; // ------ $con = mysql_connect($server, $username, $password); mysql_select_db($database , $con); // --- I'll do two simple examples of the same thing $query_a = "SELECT COUNT(client_id) FROM clients"; $query_b = "SELECT count(client_id) FROM clients"; $result_a = mysql_query($query_a); $result_b = mysql_query($query_b); // You can acces data like this $row_a = mysql_fetch_array($result_a); $row_b = mysql_fetch_array($result_b); // now you can work directly with the result // NOTE, the mysql_fetch_array's function index is case sensitive, // so be carefull echo $row_a['COUNT(client_id)']; echo $row_b['count(client_id)']; ?>

« previous php.notes (#115458) next »