Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
php mysql search with dynamic links..
Old 07-15-2005, 07:24 AM php mysql search with dynamic links..
Junior Talker

Posts: 1
Trades: 0
hi guys, im abit stuck with sumink and well if any one here can help me id really appreciate it!

anyway i have a form where people type what they wana search click the button and go..

rite i can do that and i can get it to produce the results matching the criteria the thing is i wana do 3 results per page so there will be a dynamic link system at the bottom. well.. ive looked around and i can pretty much sort out the links.. i can get the search bit to work.

$result = mysql_query("SELECT * FROM table_name LIMIT $recordsfrom,
$pagelimit");
while ($row = mysql_fetch_array($result)) {
{
?>
<?=$row['field_name']?>
<?
}
?>

this i can understand with the limit bit which helps the dynamic links but when i add the search stuff i just get an error.

$result = mysql_query("SELECT * FROM table_name WHERE prop_type='$type' AND town='$town' AND range='$range' ORDER BY id ASC LIMIT $recordsfrom,
$pagelimit");
while ($row = mysql_fetch_array($result)) {
{
?>
<?=$row['field_name']?>
<?
}
?>

can any 1 help me pleaaaaase!?!?!.. i guess it works abit like a search engine but feck knows how!
khuti is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 07-15-2005, 09:12 PM
Junior Talker

Posts: 4
Trades: 0
PHP Code:
<?php

$sql 
mysql_query('SELECT field1,field2 FROM 
                `table_name` 
            WHERE 
                prop_type LIKE "%'
.$_GET['type'].'%" 
            AND
                town LIKE "%'
.$_GET['town'].'%" 
            AND
                range LIKE "%'
.$_GET['range'].'%" 
            ORDER by id ASC LIMIT '
.$recordsfrom.','.$pagelimit.'')or die( mysql_error() );

If( 
mysql_num_rows($sql) )
{
    while( 
$r mysql_fetch_assoc($sql) )
    {
        echo 
$r['field1'].' - '.$r['field2'].'<br>';
    }
}
Else
{
    echo 
'No results..';
}

mysql_free_result($sql);
mysql_close();

?>

Last edited by Enrico; 07-15-2005 at 09:14 PM.. Reason: [PHP] Tags
Enrico is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to php mysql search with dynamic links..
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.10142 seconds with 12 queries