Php mysql help....

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vonnero
Forum Newbie
Posts: 17
Joined: Tue Feb 17, 2009 6:19 am

Php mysql help....

Post by vonnero »

i have this code but it doesnt seem to produce the correct results can anybody help me? is there something wrong with this block?

i am using this code below to get the variables;
-----------------------------------------
$pid= 0;
if(isset($_GET['recordID'])){
$pid= $_GET['recordID'];
}

$spid=strtoupper($pid);
$pc= 0;
if(isset($_GET['pc'])){
$pc= $_GET['pc'];
}

----------------------------



mysql_select_db($database_property, $property);
$query_pview = "SELECT * FROM landlords where postcode like '%$pid' or postcode= '$spid'";
$query_limit_pview = sprintf("%s LIMIT %d, %d", $query_pview, $startRow_pview, $maxRows_pview);
$pview = mysql_query($query_limit_pview, $property) or die(mysql_error());
$row_pview = mysql_fetch_assoc($pview);

is there a better option on how to search the database? Thanks.
User avatar
susrisha
Forum Contributor
Posts: 439
Joined: Thu Aug 07, 2008 11:43 pm
Location: Hyderabad India

Re: Php mysql help....

Post by susrisha »

what is the error or the result that you are getting? Can you be more elaborate?
vonnero
Forum Newbie
Posts: 17
Joined: Tue Feb 17, 2009 6:19 am

Re: Php mysql help....

Post by vonnero »

Thanks for the response, no matter the value of the GET variable..... it bring out the same result.

even if the postcodes changes, it gets the sam result for N15, N22, E1,E7.
Post Reply