close ad
Databridge V2 with MySQLi support IS Now Available!
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

URL parameter with 2 vaiables

Thread began 9/17/2009 3:45 pm by colin282897 | Last modified 9/18/2009 11:40 am by colin282897 | 1060 views | 4 replies


URL parameter with 2 vaiables

I have a simple recordset that displays records from a url posted to it.
The record set only looks at one field in a table but I want to be able to send 2 variables to this record set ie send variable1 and variable2 in a url. I then need the record set to show all entries in the table that match either variable1 or variable2.

Currently it looks like this

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
return $theValue;

$colname_company_list = "-1";
if (isset($_GET['region'])) {
$colname_company_list = (get_magic_quotes_gpc()) ? $_GET['region'] : addslashes($_GET['region']);
mysql_select_db($database_brighton, $brighton);
$query_company_list = sprintf("SELECT * FROM directory WHERE region = %s ORDER BY listing_type ASC, business_name ASC", GetSQLValueString($colname_company_list, "text"));
$company_list = mysql_query($query_company_list, $brighton) or die(mysql_error());
$row_company_list = mysql_fetch_assoc($company_list);
$totalRows_company_list = mysql_num_rows($company_list);

mysql_select_db($database_brighton, $brighton);
$query_region = "SELECT * FROM regions ORDER BY region ASC";
$region = mysql_query($query_region, $brighton) or die(mysql_error());
$row_region = mysql_fetch_assoc($region);
$totalRows_region = mysql_num_rows($region);

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question





Ease of use


security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...