Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
when i open this script it just shows a blank page, what is wrong, the aim of the script is to put the search criteria into a variable.Code: Select all
<?php
if(isset($_POST['findThis'])){
# find exact match:
$sql = "SELECT * FROM `myTable` WHERE `colName`='" . $_POST['searchVar'] . "'";
# OR find similar match:
$sql = "SELECT * FROM `myTable` WHERE `colName` LIKE '%" . $_POST['searchVar'] . "%'";
$query = mysql_query($sql,$resource);
while($row = mysql_fetch_assoc($query)){
print_r($row);
}
}
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]