report

Simple Search Using PHP and MySQL

I'm going to show you how to create simple search using PHP and MySQL. You'll learn:

  • How to use GET and POST methods
  • Connect to database
  • Communicate with database
  • Find matching database entries with given word or phrase
  • Display results

Preparation

You should have Apache, MySQL and PHP installed and running of course (you can use XAMPP for different platforms  or  WAMP for windows, MAMP for mac) or a web server/hosting that supports PHP and MySQL databases.

Let's create database, table and fill it with some entries we can use for search:

  • Go to phpMyAdmin, if you have server on your computer you can access it at http://localhost/phpmyadmin/
  • Create database, I called mine tutorial_search
  • Create table I used 3 fields, I called mine articles.
  • Configuration for 1st field. Name: id, type: INT, check AUTO_INCREMENT, index: primary

INT means it's integer
AUTO_INCREMENT means that new entries will have other(higher) number than previous
Index: primary means that it's unique key used to identify row

  • 2nd field: Name: title, type: VARCHAR, length: 225

VARCHAR means it string of text, maximum 225 characters(it is required to specify maximum length), use it for titles, names, addresses
length means it can't be longer than 225 characters(you can set it to lower number if you want)

  • 3rd field: Name: text, type: TEXT

TEXT means it's long string, it's not necessary to specify length, use it for long text.

  • Fill the table with some random articles(you can find them on news websites, for example: CNN, BBC, etc.). Click insert on the top menu and copy text to a specific fields. Leave "id" field empty. Insert at least three.

It should look something like this:


  • Create a folder in your server directory and two files: index.php and search.php (actually we can do all this just with one file, but let's use two, it will be easier)
  • Fill them with default html markup, doctype, head, etc.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Search</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>

</body>
</html>
  • Create a form with search field and submit button in index.php, you can use GET or POST method, set action to search.php. I used "query" as name for text field

GET - means your information will be stored in url (http://localhost/tutorial_search/search.php?query=yourQuery)
POST - means your information won't be displayed it is used for passwords, private information, much more secure than GET

<form action="search.php" method="GET">
	<input type="text" name="query" />
	<input type="submit" value="Search" />
</form>

Ok, let's get started with php.

  • Open search.php
  • Start php (<?php ?>)
  • Connect to a database(read comments in following code)

<?php
	mysql_connect("localhost", "root", "") or die("Error connecting to database: ".mysql_error());
	/*
		localhost - it's location of the mysql server, usually localhost
		root - your username
		third is your password
		
		if connection fails it will stop loading the page and display an error
	*/
	
	mysql_select_db("tutorial_search") or die(mysql_error());
	/* tutorial_search is the name of database we've created */
	
	
	
?>

You can go and check if there is no errors.

  • Now go to the <body></body> part of the page
  • I'm using GET method, if you want to use POST, just use $_POST instead of $_GET
  • Also some functions to make it more secure. Read comments in the code
  • Send query to database
  • Check if there is any results
  • If there is any, post them using while loop

<?php
	$query = $_GET['query']; 
	// gets value sent over search form
	
	$min_length = 3;
	// you can set minimum length of the query if you want
	
	if(strlen($query) >= $min_length){ // if query length is more or equal minimum length then
		
		$query = htmlspecialchars($query); 
		// changes characters used in html to their equivalents, for example: < to &gt;
		
		$query = mysql_real_escape_string($query);
		// makes sure nobody uses SQL injection
		
		$raw_results = mysql_query("SELECT * FROM articles
			WHERE (`title` LIKE '%".$query."%') OR (`text` LIKE '%".$query."%')") or die(mysql_error());
			
		// * means that it selects all fields, you can also write: `id`, `title`, `text`
		// articles is the name of our table
		
		// '%$query%' is what we're looking for, % means anything, for example if $query is Hello
		// it will match "hello", "Hello man", "gogohello", if you want exact match use `title`='$query'
		// or if you want to match just full word so "gogohello" is out use '% $query %' ...OR ... '$query %' ... OR ... '% $query'
		
		if(mysql_num_rows($raw_results) > 0){ // if one or more rows are returned do following
			
			while($results = mysql_fetch_array($raw_results)){
			// $results = mysql_fetch_array($raw_results) puts data from database into array, while it's valid it does the loop
			
				echo "<p><h3>".$results['title']."</h3>".$results['text']."</p>";
				// posts results gotten from database(title and text) you can also show id ($results['id'])
			}
			
		}
		else{ // if there is no matching rows do following
			echo "No results";
		}
		
	}
	else{ // if query length is less than minimum
		echo "Minimum length is ".$min_length;
	}
?>

Done!

Now it works. Try different words, variations, editing code, experiment. I'm adding full code of both files in case you think you've missed something. Feel free to ask questions or ask for tutorials.

index.php

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Search</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
	<form action="search.php" method="GET">
		<input type="text" name="query" />
		<input type="submit" value="Search" />
	</form>
</body>
</html>

search.php

<?php
	mysql_connect("localhost", "root", "") or die("Error connecting to database: ".mysql_error());
	/*
		localhost - it's location of the mysql server, usually localhost
		root - your username
		third is your password
		
		if connection fails it will stop loading the page and display an error
	*/
	
	mysql_select_db("tutorial_search") or die(mysql_error());
	/* tutorial_search is the name of database we've created */
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Search results</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<link rel="stylesheet" type="text/css" href="style.css"/>
</head>
<body>
<?php
	$query = $_GET['query']; 
	// gets value sent over search form
	
	$min_length = 3;
	// you can set minimum length of the query if you want
	
	if(strlen($query) >= $min_length){ // if query length is more or equal minimum length then
		
		$query = htmlspecialchars($query); 
		// changes characters used in html to their equivalents, for example: < to &gt;
		
		$query = mysql_real_escape_string($query);
		// makes sure nobody uses SQL injection
		
		$raw_results = mysql_query("SELECT * FROM articles
			WHERE (`title` LIKE '%".$query."%') OR (`text` LIKE '%".$query."%')") or die(mysql_error());
			
		// * means that it selects all fields, you can also write: `id`, `title`, `text`
		// articles is the name of our table
		
		// '%$query%' is what we're looking for, % means anything, for example if $query is Hello
		// it will match "hello", "Hello man", "gogohello", if you want exact match use `title`='$query'
		// or if you want to match just full word so "gogohello" is out use '% $query %' ...OR ... '$query %' ... OR ... '% $query'
		
		if(mysql_num_rows($raw_results) > 0){ // if one or more rows are returned do following
			
			while($results = mysql_fetch_array($raw_results)){
			// $results = mysql_fetch_array($raw_results) puts data from database into array, while it's valid it does the loop
			
				echo "<p><h3>".$results['title']."</h3>".$results['text']."</p>";
				// posts results gotten from database(title and text) you can also show id ($results['id'])
			}
			
		}
		else{ // if there is no matching rows do following
			echo "No results";
		}
		
	}
	else{ // if query length is less than minimum
		echo "Minimum length is ".$min_length;
	}
?>
</body>
</html>

Comments 124 comments

sherin 4 years ago

very nice coding


adam 4 years ago

very nice coding thanks


shahab 4 years ago

very good


Kyra 4 years ago

Thanks...

Very helpful of you :)


Vlad 4 years ago

Access denied for user 'u589737042_maxi'@'10.1.2.7' to database 'search_bar'. :( please help


gvssi 4 years ago

thanks lot nice coding


dockster 4 years ago

Thank you this is very useful!


Eoin H 4 years ago

This is just what I needed, a simple way to help me create a search page on my site... and it works perfectly. Thanks for posting it!

I would expect as my websites database get filled up more, the search results page would start to get very long. Is there a way to paginate the results so only say 10 results are shown on each page?

Again, thanks for the above code, many will benefit and learn from it.


csk157 profile image

csk157 4 years ago from Denmark Author

In order to paginate you would use "LIMIT".

Which would look like:

SELECT * FROM articles

WHERE (`title` LIKE '%".$query."%') OR (`text` LIKE '%".$query."%') LIMIT 0, 5

Where 0 is row to start with (offset), and 5 is amount. 0, 5 would get first 5 rows that matched the query.

so the next page would be: 5, 5

then 10, 5 - 15, 5 ... etc...

You will find plenty information about pagination on google, but that's basically how it works :)


csk157 profile image

csk157 4 years ago from Denmark Author

Thank you all for nice comments :)

You may also want to look into PDO statements (newer stuff) as this article is a bit outdated already :)


Tejinder Singh 4 years ago

thank you very much for giving this great info.


ALEX 4 years ago

You are the MAN! Thank you!


foluso 4 years ago

Please what is happening when your search is only responding to only one search term


csk157 profile image

csk157 4 years ago from Denmark Author

You can do

... LIKE '%term1%' OR LIKE '%term2%' OR LIKE '%term3%' ....

or something similar, is that what you wanted?


dikimgl 4 years ago

very useful... add more queries good luck!


chandan pandey 3 years ago

nice code..

thank u dear.....


fng 3 years ago

Access denied for user 'root'@'%' to database 'Database_name'

i got this error whilst connecting and i have put all the correct connection details.. Any help?


binesh 3 years ago

Very nice code for searching with any word.


Patrick 3 years ago

Hi, i used the code to search and it works very well, but when i asking the system to give me a few fields as a result of the search, i do not get a space between each field, consequently everything ends up as one very long word

thank you in anticipation for your assistance


omarluces05 3 years ago

thank you so much for this simple but great tutorial. :)


Lasha 3 years ago

Thank you very much... I done it at first try and it's great script thank you very much again again and again :DDD


Sumair 3 years ago

superb work..! its easier and excellent


omarluces05 3 years ago

Hi csk157,

This tutorial really works for me.

but can you help me on my concern? :)

Example:

I'm searching for a NAME.

"Mary Josephine S. Cruz"

*when I input 'Mary' it shows the result.

*when I input 'MARY JOSEPHINE' it shows result.

**but when I input 'MARY JOSEPHINE CRUZ', without the Middle Initial it shows NO RESULTS.

What can I do with this? that when I input 'MARY JOSEPHINE CRUZ', it should search either 'MARY' / 'JOSEPHINE' / 'CRUZ' ?

Hope you can help me. :)

Thanks.


csk157 profile image

csk157 3 years ago from Denmark Author

omarluces05

you could either try adding 'OR' between all possible variations which would be kind of sloppy

or by doing full-text search, some information about it:

http://dev.mysql.com/doc/refman/5.5/en//fulltext-s...

so in the end it would be something similar to this:

SELECT *, MATCH(name) AGAINST ('Mary Josephine Cruz') AS score FROM users WHERE MATCH(name) AGAINST ('Mary Josephine Cruz') ORDER BY score DESC

results will contain one more column called `score`. The higher the number in that column, the more relevant row it is (better match).

P.S. you have to add full-text index to the columns you want to match against (please google it)


Mr Akheel 3 years ago

Thank you So much Bro.. I was searching script exactly like this.. U r Gr8.. Nice Tutorial.. easy to understand... i'm doing Local Search Project..


Algis 3 years ago

good stuff for the begginer :) Thanks a lot!!!


jenn 3 years ago

please help am using the code but when i try to search anything i get an error:"minimum legth" and the page is just blank


lerry 3 years ago

can i put together a 2 tables in one search button ? :)


broglah 3 years ago

hey i've implemented this, search query.

one question I have modified it so that I have 3 images per row stored in the database(I know this is bad practace but I'm a noob), how could I return these images in the search, i'm going to paginate this also.

I only want the images returned with the value of the rowID

any help will be much appreciated.


csk157 profile image

csk157 3 years ago from Denmark Author

I would store images in your website folder (for example in "images" directory), and then would save path to images in database (images/superimage.png)

If you want to search for them, you need some tags, or titles or any text to differentiate between them.

When you do something like this, you use LIKE, or MATCH to find rows. (for pagination use look up LIMIT function in SQL and use math for to calculate which entries to get. For instance: first page - LIMIT 0, 5; second page - Limit 5, 5 and so on...)

To show images just use

img src="$image_path_from_database"

I hope that helps


Manjinder Singh 3 years ago

Very usefull Post for me,


Mr Dilip Wijayabahu 3 years ago

so thanks for this tutorial .it's so help full to my web developing knowledge .


skr 3 years ago

thanks boSSSSSSS


Dermot 3 years ago

Great tutorial - I finally managed to get text searching working on my forms!

Im wondering though, how do I implement multi multi form field searching? My SQL command is:

$result=mysql_query("SELECT * FROM tablename WHERE (firsttablecol LIKE '%".$query['firstformfield']."%') AND (secondtablecol LIKE '%".$query['secondformfield']."%') ", $connection) or die ("Cannot run query");

but this returns all entries in my MySQL database. I want people to be able to search on either one or both fields, so a form field may also contain empty entries? Thanks


pals10 3 years ago

This tutorial was really very helpful for a beginner like myself. Great stuff. :) Could you also help me with the code for inserting/modifying/deleting records from my database where whatever modifications are to be made would be entered via an html form?


Philip 3 years ago

How to make exact search? If I search word "Book" I need the result with word "Book" in MySQL row, using this code if I look "Book" it gives me all results with this word like "Books for children", "Books for adults" etc.


aya adel 3 years ago

how can i make an search text in data base


Kemal 3 years ago

Code is running.. Thank you so much :D


spyrosL 3 years ago

Access denied for user 'apache'@'localhost' (using password: NO)


Nomer 3 years ago

thanks tro your code its runnig..

thank you sir


muziek 3 years ago

Thanks for the code. But my question is how can i make the info clickable? the search shows my products en their categories but want that if you click on the name that you go to the page of the product


Mohammad Murad Hosen 3 years ago

Awesome.Awesome .Awesome

Thanks bro very very much


billy miaron 3 years ago

waoh great tutorial. can you add links to the search results? for example a link to that persons full profile?

am looking for that.


Richard 3 years ago

Hi.

Thanks for this solution! It is great! I`m new at mysql and php. I did everything as said but stucked at the article making. Where did You make those aticles. Did You made new tables or just made those articles under some "edit0" option?


Sabbir Jaman 3 years ago

fine thanks

i try this carefully...

thanks this committee


Selim Alamo 3 years ago

Hey, perfect code!!!! Thank you!!!

How can I clear the search field after pressing send button?

thank you again


Selim Alamo 3 years ago

Ah, and one more question please.

I am using this search plugin for passport number.

For example, the pass number is 12345678-5 and if I search 12345678- (without the 5) the plugin show me anyway the result, I mean, it searches the whole words, and I would like to search for exact words.

Thank you!


csk157 profile image

csk157 3 years ago from Denmark Author

@Selim

For exact search you better use simple comparison. For example:

SELECT * FROM persons WHERE passport_number = '12345678-5'

numbers being the query. In this case if it does not find exact match - it won't return any results.

Regarding clearing the search field after sending form - it should happen automatically after the form is submitted (page is reloaded), if not check that you are not printing $_GET['query'] into value attribute of the text field.

I hope this helps


Selim Alamo 3 years ago

@csk157, thank you very much!

Last question.

If you open in your browser the file search.php, you will see an alert message (Minimum length is...). Also, I wanted to make the search just in 1 file, but i have the same message.

I hope you can help me!


csk157 profile image

csk157 3 years ago from Denmark Author

It has something to do with

if(strlen($query) >= $min_length){ ... search here... }

else{ // if query length is less than minimum

echo "Minimum length is ".$min_length;

}

so check if it is correct, and also check that your query is longer that $min_length (if you don't need check - remove 'if' sentence, or if you don't want to print any message, remove 'else' part of 'if')

make sure that you're not opening (before you submit the form) your page with ?query=something attached in the link


Alexandre 3 years ago

Well done and well comment. Thanks!


Selim Alamo 3 years ago

Hi csk157!, thank you again for your answer!

I tried it, but it doesn't work :(

I mean, everything work fine less the line:

echo "Minimum length is ".$min_length;

So, in one file called passport.php I have the passport number search. If it's less than 9 symbols, it means that it is wrong.

The problem is that when I open the file (passport.php) it shows me the message "Minimum length is..." before I start the search.

Hope you can help me, and thanks again!


csk157 profile image

csk157 3 years ago from Denmark Author

Ok, try to change

if(strlen($query) >= $min_length)

to

if(isset($_GET['query']) && strlen($query) >= $min_length)


Lindsay 3 years ago

Hi csk157,

Great tutorial here, as you stated above "use PDO statements". Why don't you create a new article that replaces all those mysql_* statements in the above article with PDO statements?

I'm sure there are many people, including me, who are frustrated in finding tutorial on how to integrate PDO to create search page.

I've been searching around for days and not a single tutorial explaining how to create a search page with PHP PDO.

oh, one more thing, thanks for the great article ;)

waiting for the PDO edition.


csk157 profile image

csk157 3 years ago from Denmark Author

Selim, it would be easier to help you if you attached your code (use http://pastebin.com/ or simillar, as in comment it will be messy)

Hi, Lindsay. Thanks, but I am not planning to write anything anytime soon though :). I have moved from PHP to other languages (and I don't have much interest in it).

P.S. if you are doing a serious website (and not just for learning purposes), you may want to use some framework, such as Laravel :)


dsbpac 3 years ago

Can you give us an example of this amazing code with paginate?? Please!! Thank you


sally 3 years ago

wow perfect code.

it's work.

but can i know how to display the searched result in the same page with the index.php?

I want to create a page which is the search form(search button) is at the top and the searched result will display below it.

Hope you can help me :)

Thank you.


dev 3 years ago

thanks very helpful codding


skip 3 years ago

How do you get the results that you searched for in the database displayed in a table


mladen88 3 years ago

Hi

thanx for tutorial

Question: How to search from 2 database tables ? (same database)


Nikolay 3 years ago

Hello. Script works fine. Could you please tell me which code should I add to "search.php" to realise sorting by 1 column of database using dropdown menu (like sorting by cities here: http://www.phpjabbers.com/free-scripts/mysql-searc... ). Thank you!


shyam bahadur sunari magar 2 years ago

really useful.. thanks a lot once & infinity.........


karun 2 years ago

good


Cyrus Besabella 2 years ago

thanks for this wonderful articles! simple and easy to understand tut!


Karl Jennings 2 years ago

Just what I was looking for.


Sarfaraz 2 years ago

Very nice tutorial because everything has been explained in detail. Sir one question if I wanted to display only 100 words in with a read more link and when clicking the link display the whole text.

Thank you

Sarfaraz


karthick 2 years ago

100% working thanks ...


Akash kumar 2 years ago

Very Nice explained


Qwerty 2 years ago

That was really useful, thank you very much )


milanj82nis 2 years ago

Thanks for script.


Alex Alvarez 2 years ago

wow, i really love this tutorial! but tell us how to make it for categories?


Athirah 2 years ago

Hi. great tutorial you have here. but i wonder. If i would like to make them both in a single page, there'd be an error that says "Undefined index: query" could you help me? thanks


Zac 2 years ago

Thank you! Had so much trouble before and this tutorial worked like a charm!


özkan 2 years ago

good example


Nabilah 2 years ago

Thank you for this code. Its work :) .but if i wanna put image or pdf for download also what should I do then?


Gandalf 2 years ago

Thnx!


Kprinja 2 years ago

thnx a ton for coding... working properly..:)


dw 2 years ago

thank u sooooooooo much, u helped me a lot and i think ur awesome for taking the time to do this


Burhan 2 years ago

you are amazing!


Gurpreet Singh 2 years ago

Great explanation. Thank you.


jayanta deb 2 years ago

thanks a lots


STAN 2 years ago

Thank You.


Adam 22 months ago

Very nice and very simple.....i love man


Ben 22 months ago

Hey, i just want to say your codes help me with my work. Thanks alot!


cosmicdisco 21 months ago

hey super cool code, i have a question. how is possible to emphasize only the search words? thanks


ricky 21 months ago

its good


PKreturns profile image

PKreturns 21 months ago from Bangalore, India

Your only hub but very much informative particularly for web developer like me


pinnaclei 19 months ago

nice coding , very useful , thank you


dk45516 18 months ago

is it possible to code for a search for numerical values, such that entering the number in the search box will return values that are less than the entered value available in the database in a particular column.


kumar 18 months ago

nice coding thank you.


sino 18 months ago

Bless u i was tired for days trying to this


Rajan 17 months ago

nice coding !


Bwire sedrick 17 months ago

Thanks sooooooooooo much


arun gautam 15 months ago

Great Code thanks and God Bless you


vk 14 months ago

error

Notice: Undefined index: query in _____________.php on line 14


Vladimaire 14 months ago

it always show:

"Parse error: syntax error, unexpected '$query' (T_VARIABLE) in C:\xampp\htdocs\newWebProg\search.php on line 13"

line 13 is:

"    $query = $_GET["query"]; "

what might be the problem?


Ayesha Ch 11 months ago

i cannot run my search engine queury


chimfwembe 11 months ago

After the sql select statement the number of open curly braces does not match the closing curly braces hencing making display diffcult for me, unless there is something am missing, please help


True 8 months ago

thank you so much :) I've been in a lot of tutorials and none of them works like the way I wanted to


gids 8 months ago

this is the error i get... You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'info1 '%gistoncelebrities%')' at line 2


gids 8 months ago

thanks again.. how can i make this work if what i'm searching for is a file say (.mp3) that i need to download?? will really like your help on these..


opanga Richard 7 months ago

Great article!!!!!!!!


JimG 6 months ago

Hi. I have keywords in a column in my database separated by a space. If I try putting spaces around my search term like, "$vidhints LIKE '% $search_each %'" the search misses some records because there's a space at the front of some of my keywords in the table. E.g., my keyword column has: "recurring services software" So, when I do a search for "recurring" it works, but if I do a search for "services" the search only works if I put a space before the word services. I guess because that's how it is in the database? How do I get around this if I only want to match the word? E.g., if I search for "recurring services" zero results display.


MArk 5 months ago

When i tried your code, it displayed : error .. undefined' query'.

The query is already defined by name.

So any idea?


Maxime 4 months ago

Why not just use PDO and HTML5 to begin with instead of outdated stuff. This is absolutely no help.


shahdab 4 months ago

i want search in complete database


seng 4 months ago

what does it mean? please help me solve.tq

Parse error: syntax error, unexpected 'Â Â Â Â Â ' (T_STRING) in C:\xampp\htdocs\RTest1\users\sear.php on line 10


Manolis 3 months ago

nice code..

thank you


Shawn 3 months ago

Thankyou!


Diya 2 months ago

Error connecting to database: Access denied for user 'root'@'localhost' (using password: YES)

How to Connect the cpanel database

Please help Me


Diya 2 months ago

Access denied for user 'npdassoc'@'localhost' to database 'tutorial_search'

Please Help Me


Mohammed Shamshid 2 months ago

How can i highlight all the keyword given in the text field to search, in result page?


Gary WHY 2 months ago

Thank you so much....


Nizaka 2 months ago

At least, wonderfull ! Thanks a lot


Sujon 8 weeks ago

If I wrote

$query = $_POST['query'];

Showing Length :

Minimum length is 3


AS 7 weeks ago

thanks


abhi 7 weeks ago

helped alot thnx :)


Passenger 4 weeks ago

It works perfectly, thank you very much! I just edited with the newer MSQLi commands (it needs only littel adjustments) and it still works fine :)


peter 4 weeks ago

Thank you, it works! One little thing..When I write a " ' " it converts to a " \' " e.g. " 'search' " converts to "\'search\' ". How does it happen and how can I prevent this?


Frazier 2 weeks ago

Hi.

I'm 'NEW' at coding.

When I input the code, i keep getting blank results. What does this mean?


sreylak 10 days ago

so nice code , thanks


Hussein Sarkar 33 hours ago

hey, awesome coding and well explained. Thanks alot!


Hussein Sarkar 25 hours ago

Hello, please can u guide me on how i can use the code posted above to delete a record in the mysql database using the ID? Thanking in advance.


Manav Kharat 13 hours ago

Thanks

Your article helped me a lot...

    Sign in or sign up and post using a HubPages Network account.

    0 of 8192 characters used
    Post Comment

    No HTML is allowed in comments, but URLs will be hyperlinked. Comments are not for promoting your articles or other sites.


    Click to Rate This Article

    Menu

    Explore