View Single Post
  #1 (permalink)  
Old 04-13-2008, 02:51 AM
mac-in-the-mountains
 
Posts: n/a
Diggs:
Default defining recordset according to first three digits ofcode

I need to create a recordset which contains records matching the first three
digits only of a URL parameter.

I have a recordset that contains records matching the code exactly (attached
below)

I need also to create a recordset which contains records that match the first
three digits ONLY of a URL parameter.
I guess it may also be an option to duplicate the parameter in the URL and
restrict the duplicate to three digits only - that way making the creation of
the recordset easy - but I don't know how to do that either.

Can anyone help me out with this one?

Cheers


Dave



$query_rs_allcourses = sprintf("SELECT * FROM courses WHERE coursecode LIKE
CONCAT('%%', %s, '%%') ORDER BY title ASC",
GetSQLValueString($colname_rs_allcourses, "text"));
$rs_allcourses = mysql_query($query_rs_allcourses, $con_dcc) or
die(mysql_error());
$row_rs_allcourses = mysql_fetch_assoc($rs_allcourses);
$totalRows_rs_allcourses = mysql_num_rows($rs_allcourses);



Reply With Quote
Sponsored Links