Search
Search titles only
By:
Search titles only
By:
Log in
Register
Search
Search titles only
By:
Search titles only
By:
Menu
Install the app
Install
Forums
New posts
All threads
Latest threads
New posts
Trending threads
Trending
Search forums
What's new
New posts
New ads
New profile posts
Latest activity
Free Ads
Latest reviews
Search ads
Members
Current visitors
New profile posts
Search profile posts
Contact us
Latest ads
Colombo
RidhMathraa ’26 🎶✨
Tmadhusanka
Updated:
Wednesday at 11:58 PM
Ad icon
Colombo
PXN V10 Pro Direct Drive Racing Wheel (Under Warranty)
Abdur Rahman
Updated:
Wednesday at 10:23 PM
Ad icon
USDT ණය සේවාව - USDT Loan Service
පුරවැසියා
Updated:
Wednesday at 4:54 PM
Ad icon
🎮 INDIAN PSN GIFT CARDS AVAILABLE NOW! 🎮
madukaperera
Updated:
Tuesday at 12:57 PM
🚀 Google AI PRO – 18 Months | Rs. 850 Only
lkkolla
Updated:
Monday at 4:56 PM
Electronics
Vehicles
Property
Search
Reply to thread
Forums
General
ElaKiri Help
Need PHP help
Get the App
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Message
<blockquote data-quote="Tharindu DR" data-source="post: 2715796" data-attributes="member: 17360"><p>Im creating a search page.</p><p>I need to search few data bases within one page so I used a como box to change tables, I dont know about PHP sooo this might be wrong.</p><p></p><p>If some one know a better way pls help me thanx.</p><p></p><p>Here is The Form :</p><p></p><p><strong><form id="form1" name="form1" method="post" action=""></strong></p><p><strong> <label>Search :</strong></p><p><strong> <input type="text" name="q" id="q" /></strong></p><p><strong> </label></strong></p><p><strong> <label></strong></p><p><strong> <input type="submit" name="btn" id="btn" value="Search" /></strong></p><p><strong> </label></strong></p><p><strong> <label></strong></p><p><strong> <select name="lst" id="lst"></strong></p><p><strong> <option value="<?php $table = 'book_new_item';?>">Books</option></strong></p><p><strong> <option value="<?php $table = 'comp_new_item'; ?>">Computers</option></strong></p><p><strong> <option value="<?php $table = 'mob_new_item' ;?>">CellPhones</option></strong></p><p><strong> <option value="<?php $table = 'clothe_new_item'; ?>">Clothing</option></strong></p><p><strong> <option value="<?php $table = 'camera_new_item'; ?>">Cameras</option></strong></p><p><strong> <option value="<?php $table = 'dvd_new_item' ;?>">DVDs</option></strong></p><p><strong> <option value="<?php $table = 'sport_new_item'; ?>">Sporting</option></strong></p><p><strong> <option value="<?php $table = 'toy_new_item' ;?>">Toys</option></strong></p><p><strong> <option value="<?php $table = 'music_new_item' ;?>">Musical</option></strong></p><p><strong> <option value="<?php $table = 'other_new_item' ;?>">Others</option></strong></p><p><strong> </select></strong></p><p><strong> </label></strong></p><p><strong></form></strong></p><p></p><p>Here is the SQL : ( Both in the same page)</p><p></p><p><strong>mysql_select_db($database_localhost, $localhost);</strong></p><p><strong>$query_search = sprintf("SELECT topic, detail, name, `datetime`, reply FROM $table WHERE topic LIKE %s", GetSQLValueString("%" . $colname_search . "%", "text"));</strong></p><p><strong>$query_limit_search = sprintf("%s LIMIT %d, %d", $query_search, $startRow_search, $maxRows_search);</strong></p><p><strong>$search = mysql_query($query_limit_search, $localhost) or die(mysql_error());</strong></p><p><strong>$row_search = mysql_fetch_assoc($search);</strong></p></blockquote><p></p>
[QUOTE="Tharindu DR, post: 2715796, member: 17360"] Im creating a search page. I need to search few data bases within one page so I used a como box to change tables, I dont know about PHP sooo this might be wrong. If some one know a better way pls help me thanx. Here is The Form : [B]<form id="form1" name="form1" method="post" action=""> <label>Search : <input type="text" name="q" id="q" /> </label> <label> <input type="submit" name="btn" id="btn" value="Search" /> </label> <label> <select name="lst" id="lst"> <option value="<?php $table = 'book_new_item';?>">Books</option> <option value="<?php $table = 'comp_new_item'; ?>">Computers</option> <option value="<?php $table = 'mob_new_item' ;?>">CellPhones</option> <option value="<?php $table = 'clothe_new_item'; ?>">Clothing</option> <option value="<?php $table = 'camera_new_item'; ?>">Cameras</option> <option value="<?php $table = 'dvd_new_item' ;?>">DVDs</option> <option value="<?php $table = 'sport_new_item'; ?>">Sporting</option> <option value="<?php $table = 'toy_new_item' ;?>">Toys</option> <option value="<?php $table = 'music_new_item' ;?>">Musical</option> <option value="<?php $table = 'other_new_item' ;?>">Others</option> </select> </label> </form>[/B] Here is the SQL : ( Both in the same page) [B]mysql_select_db($database_localhost, $localhost); $query_search = sprintf("SELECT topic, detail, name, `datetime`, reply FROM $table WHERE topic LIKE %s", GetSQLValueString("%" . $colname_search . "%", "text")); $query_limit_search = sprintf("%s LIMIT %d, %d", $query_search, $startRow_search, $maxRows_search); $search = mysql_query($query_limit_search, $localhost) or die(mysql_error()); $row_search = mysql_fetch_assoc($search);[/B] [/QUOTE]
Insert quotes…
Verification
Hathara warak wissa keeyada? (Hathara wadi karanna 20)
Post reply
Top
Bottom