plea
11-19-2007, 04:59 PM
Ive got a script to report on domains with three options.
Domain hlq
without numbers
without hyphens
Im trying to add the last option - to select by size
How would I select by size with all the options being optional.
[^0-9-]+\\.co\\uk$
PHP script that builds SQL for report
$sql = "\\\.uk$";
if($_REQUEST['s']{1} == "1") { $sql = "co".$sql; }
if($_REQUEST['s']{2} == "1") { if($_REQUEST['s']{3} == "1") { $sql = "^[^0-9-]+".$sql; }}
if($_REQUEST['s']{2} != "1") { if($_REQUEST['s']{3} == "1") { $sql = "^[^-]+".$sql; }}
if($_REQUEST['s']{2} == "1") { if($_REQUEST['s']{3} != "1") { $sql = "^[^0-9]+".$sql; }}
if(strlen($_REQUEST['s']) != "4") { $sql = "\\\.uk$"; }
$result = mysql_query("SELECT * FROM `tbl` WHERE `domain` REGEXP CONVERT(_utf8 '$sql' USING latin1) COLLATE latin1_swedish_ci ORDER BY `dt` DESC LIMIT 20");
Any help please!
Domain hlq
without numbers
without hyphens
Im trying to add the last option - to select by size
How would I select by size with all the options being optional.
[^0-9-]+\\.co\\uk$
PHP script that builds SQL for report
$sql = "\\\.uk$";
if($_REQUEST['s']{1} == "1") { $sql = "co".$sql; }
if($_REQUEST['s']{2} == "1") { if($_REQUEST['s']{3} == "1") { $sql = "^[^0-9-]+".$sql; }}
if($_REQUEST['s']{2} != "1") { if($_REQUEST['s']{3} == "1") { $sql = "^[^-]+".$sql; }}
if($_REQUEST['s']{2} == "1") { if($_REQUEST['s']{3} != "1") { $sql = "^[^0-9]+".$sql; }}
if(strlen($_REQUEST['s']) != "4") { $sql = "\\\.uk$"; }
$result = mysql_query("SELECT * FROM `tbl` WHERE `domain` REGEXP CONVERT(_utf8 '$sql' USING latin1) COLLATE latin1_swedish_ci ORDER BY `dt` DESC LIMIT 20");
Any help please!