|
||||
Try ikut tutorial aku nihs ..
CREATE TABLE tablename ( first_name VARCHAR (25), last_name VARCHAR (25) ); // Command Untuk Insert Data // add.html <html> <body> <form action=submitform.php method=GET> First Name: <input type=text name=first_name size=25 maxlength=25> Last Name: <input type=text name=last_name size=25 maxlength=25> <p> <input type=submit> </form> </body> </html> //submitform.php <html> <body> <?php mysql_connect (localhost, username, password); mysql_select_db (dbname); mysql_query ("INSERT INTO tablename (first_name, last_name) VALUES ('$first_name', '$last_name') "); print ($first_name); print (" "); print ($last_name); print ("<p>"); print ("Thanks for submitting your name."); ?> </body> </html> // Nih untuk search <html> <body> <form action=searchform.php method=GET> Search For: <p> First Name: <input type=text name=first_name size=25 maxlength=25> <p> Last Name: <input type=text name=last_name size=25 maxlength=25> <p> <input type=submit> </form> </body> </html> //searchform.php <html> <body> <?php mysql_connect (localhost, username, password); mysql_select_db (dbname); if ($first_name == "") {$first_name = '%';} if ($last_name == "") {$last_name = '%';} $result = mysql_query ("SELECT * FROM tablename WHERE first_name LIKE '$first_name%' AND last_name LIKE '$last_name%' "); if ($row = mysql_fetch_array($result)) { do { print $row["first_name"]; print (" "); print $row["last_name"]; print ("<p>"); } while($row = mysql_fetch_array($result)); } else {print "Sorry, no records were found!";} ?> </body> </html> |
![]() |
«
Previous Thread
|
Next Thread
»
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| pakai software ape buat gambo jadi mcam ni | zball | Graphic Design | 17 | 24-04-2007 01:14 AM |
| Camane nak export flash jadi movie clip ? | myravens | Website Design | 0 | 12-08-2003 05:07 PM |
| apa dah jadi????? | ergoomo | Website Design | 2 | 25-07-2003 01:35 PM |
| apekah yg mebuatkan database jadi crush ?? | full time kille | Website Programming | 5 | 01-05-2002 12:49 AM |
All times are GMT +8. The time now is 11:00 AM.
Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO 3.1.0 vBulletin skin by ForumMonkeys.com.









Linear Mode

