Re: [PHP] Retrieve specific data from MySQL

2004-02-02 Thread Jochem Maas
$lastname = (string) $_POST['lastname']; // probably want to do some sanity checks on the input // e.g. watch out for names like O'Reilly $lastname = str_replace("'","''",$lastname); // the contents of variable must be inside single quotes $sql = "SELECT * FROM table WHERE lastname='$lastname'";

Re: [PHP] Retrieve specific data from MySQL

2004-02-02 Thread John Nichel
Matt Hedges wrote: Hello, I have a basic question I can't figure out. My site lets people enter in their information... I now want to be able for a user to search the database. For example, enter in "firstname" or "lastname" in a text box, hit submit, and have the results returned. How do I wri

[PHP] Retrieve specific data from MySQL

2004-02-02 Thread Matt Hedges
Hello, I have a basic question I can't figure out. My site lets people enter in their information... I now want to be able for a user to search the database. For example, enter in "firstname" or "lastname" in a text box, hit submit, and have the results returned. How do I write this in PHP? I'