SQL Queries

From: Date: Fri, 11 Aug 2000 13:02:32 +0000
Subject: SQL Queries
Groups: php.db 
Request: Send a blank email to php-db+get-1952@lists.php.net to get a copy of this message
Tow quick questions ... 1/ Is it possible to select coun(*) from xxx where .... directly into a $variable? Rather than select * and mysql_numrows ... 2/ I am selecting from a database of UK postcodes. For Example, W13AB .. this is in London W1. Example 2 ... W113AB .. this is in London W11. If I "select * from table where postcode like '$postcode%' " and $postcode is"W1", it will pick up records for both W1 and W11. Can I "select * from table where postcode='$postcode' " But without the last three digits (i.e. W13AB -3 digits = W1)? This is doing a regular expression within the SQL query. Thanks Nick Boyle

« previous php.db (#1952) next »