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
calling mysql string at selection on radio button in php.
Old 03-24-2010, 05:06 AM calling mysql string at selection on radio button in php.
Isabella_Smith's Avatar
Ultra Talker

Posts: 285
Trades: 0
Hi,

i am calling 2 strings with the selection of radio button......one is for company and another is for category...

Here's what I am doing...

PHP Code:
$v1 'checked';
$selected_radio $_POST['category'];
if (
$selected_radio = = 'v1')
{
if(isset(
$_GET['getkeywordsByLetters']) && isset($_GET['letters'])){
    
$letters $_GET['letters'];
    
$letters preg_replace("/[^a-z0-9 ]/si","",$letters);
    
$res mysql_query("select category from tblcat where category like '".$letters."%'") or die(mysql_error());
    
    while(
$inf mysql_fetch_array($res)){
        echo 
$inf[""]."###".$inf["category"]."|";
    }
}

}
    else
    {
    if(isset(
$_GET['getkeywordsByLetters']) && isset($_GET['letters'])){
    
$letters $_GET['letters'];
    
$letters preg_replace("/[^a-z0-9 ]/si","",$letters);
    
$res mysql_query("select biz_nam, biz_addy3 from tblbusinessinfo where biz_nam like '".$letters."%'") or die(mysql_error());
    
    while(
$inf mysql_fetch_array($res)){
        echo 
$inf["biz_nam"]."###".$inf["biz_addy3"]."|";
    }
    }

The problem is its not showing any suggestion.......no error though.

Please let me know how it can be called as I want........thanks in advance.
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE



Please login or register to view this content. Registration is FREE
buy all indian salwar Kameez, Sarees and clothes
Isabella_Smith is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 03-24-2010, 07:21 AM Re: calling mysql string at selection on radio button in php.
Andy Pugh's Avatar
Extreme Talker

Posts: 203
Name: Andy
Location: N.Ireland
Trades: 0
I would imagine it's not finding any results, it won't return an error unless you ask it to.
__________________

Please login or register to view this content. Registration is FREE
Andy Pugh is offline
Reply With Quote
View Public Profile
 
Old 03-24-2010, 10:24 AM Re: calling mysql string at selection on radio button in php.
chrishirst's Avatar
Missing! presumed drunk.

Posts: 42,384
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
This
PHP Code:
if ($selected_radio = = 'v1'
should be
PHP Code:
if ($selected_radio == 'v1'
__________________
Chris. ->>
Please login or register to view this content. Registration is FREE
<<-

A foolish consistency is the hobgoblin of little minds
Thought for today:- Is SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Reply     « Reply to calling mysql string at selection on radio button in php.
 

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.11499 seconds with 12 queries