Jump to content

Glenn

New Members
  • Posts

    2
  • Joined

  • Last visited

    Never

Everything posted by Glenn

  1. Glenn

    SQL Query

    Thanks for the help. I ended up using the method you suggested. As far as using printf to build the string, that was the method suggested by the TUTORIAL!!! I simplified the query to post on line. The original query was looking for a social security number and the last name and looked like this: $SqlString = printf(\"SELECT * FROM u01_caspenrl WHERE CENMSSN = \'%s\' AND CENLAST LIKE \'%s\'\",$Social,$LastName); When I displayed it on the screen it looked correct but wouldn\'t work. Any way thanks for the help.
  2. Glenn

    SQL Query

    Hello, I am new to PHP and MYSql so this may seem like a very easy question. I\'m attempting to do a query. When I use the following code the query returns no results: $LastName = \"MILL%\"; mysql_select_db($database_UFAMySql, $UFAMySql); $SqlString = printf (\"SELECT * FROM u01_caspenrl WHERE CENLAST LIKE \'%s\'\",$LastName); $Recordset1 = mysql_query($SqlString, $UFAMySql) or die(mysql_error()); However, if I change the variable $SqlString to this, I get all the matching records. $SqlString = \"SELECT * FROM u01_caspenrl WHERE CENLAST LIKE \'MILL%\'\"; What am I missing? Thanks
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.