| | |
PHP Searching Problem...
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
Thread Solved |
Hi All, I Have a PHP Searching Code it have some problem it only connet to database but does not show any result..........
PHP Code is :-
Search.php
any one plz help me......
PHP Code is :-
Search.php
php Syntax (Toggle Plain Text)
<HTML> <BODY> <FORM Action="/Search.php" Method="POST"> <div align="center"> <table border="0" cellpadding="0" cellspacing="0"> <tr> <td bordercolor="#000000"> <p align="center"> <select name="metode" size="1"> <option value="name">Name</option> <option value="telephone">Telephone</option> <option value="birthday">Birthday</option> </select> <input type="text" name="search" size="25"> <br> Search database: <input type="submit" value="Go!!" name="Go"></p> </td> </tr> </table> </div> </form> <center> <table border="1" cellpadding="5" cellspacing="0" bordercolor="#000000"> <tr> <td width="60"><b>ID</b></td> <td width="100"><b>Name</b></td> <td width="70"><b>Telephone</b></td> <td width="150"><b>Birthday</b></td> </tr> <?php if ($_POST['Go'])//user clicks go.. { $dbh=mysql_connect ("localhost", "kuchcity_hemant", "hemgoyal") or die ('I cannot connect to the database because: ' . mysql_error()); mysql_select_db ("kuchcity_example"); ?> <?php //error message (not found message)begins $XX = "No Record Found, to search again please try again"; //query details table begins $query = mysql_query("SELECT * FROM details WHERE '$_POST[metode]' LIKE '$_POST[search]'% LIMIT 0, 50"); while ($row = @mysql_fetch_array($query)) { $variable1=$row["ID"]; $variable2=$row["Name"]; $variable3=$row["Telephone"]; $variable4=$row["Birthday"]; //table layout for results print ("<tr>"); print ("<td>$variable1</td>"); print ("<td>$variable2</td>"); print ("<td>$variable3</td>"); print ("<td>$variable4</td>"); print ("</tr>"); } //below this is the function for no record!! if (!$variable1) { print ("$XX"); } //end } ?> </table> </center> </BODY> </HTML>
any one plz help me......
Last edited by peter_budo; Mar 30th, 2008 at 6:21 am. Reason: Keep It Organized - please use [code] tags
Hi
hemgoyal
you have this one in line 3 which i marked it in red move it to small litter and chick and let me know
hemgoyal
you have this one in line 3 which i marked it in red move it to small litter and chick and let me know
•
•
•
•
<FORM Action="/Search.php" Method="POST">
To make something from nothing i a challenge
The top of The Plesure is to WIN the challenge
IraqHiTs Forums Bringing Back The Noise
The top of The Plesure is to WIN the challenge
IraqHiTs Forums Bringing Back The Noise
•
•
•
•
SELECT * FROM details WHERE '$_POST[metode]' LIKE '$_POST[search]'% LIMIT 0, 50
•
•
•
•
$row = @mysql_fetch_array($query)
Ignorance is definitely not bliss!
*PM asking for help will be ignored*
*PM asking for help will be ignored*
•
•
•
•
Dear i am Doing Your Tricx But my Problem doe's not solved yet.... Plz Dear Give me Solution of my problem.
and when i typed a name it turned me to "search.php" but with a db error cuz there i cant call your database
if you can post it i think i can help and do try what nav33n said
still around you
brb
To make something from nothing i a challenge
The top of The Plesure is to WIN the challenge
IraqHiTs Forums Bringing Back The Noise
The top of The Plesure is to WIN the challenge
IraqHiTs Forums Bringing Back The Noise
![]() |
Similar Threads
- IE6/IE7 unexpectedly drops the PHP Session ID cookie (PHPSESSID) (PHP)
- URL Rewrite in PHP (PHP)
- php header() redirect issues (PHP)
- I am New In MySQL. Problem With MySQL Database Plz Help. (MySQL)
- Filtering My sql through Php using drop down menu and text field (PHP)
- merge javascript with php... (PHP)
- Editing/Creating PHP Fields - Novice! Help? (PHP)
- mySQL database searching for registration (MySQL)
- browsing problems too much! (Web Browsers)
Other Threads in the PHP Forum
- Previous Thread: help in mail attachment
- Next Thread: php mail
| Thread Tools | Search this Thread |
apache api array basic beginner binary body broken cakephp checkbox class cms code computing cron curl database date date/time delete display dynamic echo email error file files filter folder form forms function functions gc_maxlifetime global google host href htaccess html image include insert ip javascript joomla limit link list login mail memmory memory menu mlm msqli_multi_query multiple mycodeisbad mysql navigation oop parameter parsing paypal pdf php problem query radio random recourse recursion regex remote script search seo server sessions sms source space sql static syntax system table thesishelp tutorial update upload url validator variable video web webdesign wordpress xml youtube






