Hi, I'm trying to make a simple search from 1 row/field, but the query comes back with no results. The field is a TEXT field, with numerical characters. This is my entire script. No error messages come up, so I assume that (!$result) is false.
<?php
$con = mysql_connect("localhost","user","password");
// test connection
if(!$con) {
exit("Cant connect to database");
}
$db = mysql_select_db("phone", $con);
// test database selection
if(!$db) {
exit("Cant select the database.");
}
// query the #'s from phone
$result = mysql_query("SELECT * FROM phone WHERE phonenumber LIKE '%ph%' ");
// test query
if(!$result) {
exit("Cant query results");
}
// display results
if ($row = mysql_fetch_array($result)) {
echo("<p>" . $row["ph"] . "</p>");
}
?>
Could someone please tell me what I'm doing wrong?