Click here to Skip to main content
15,891,673 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I'm trying to write a stored procedure using WAMP phpmyadmin, but it is isnt bringing any result whenever i execute in php my admin

What I have tried:

SELECT book_title 
FROM books_info
WHERE book_title
LIKE '%booktsp%'

booktsp is an "IN" parameter
i also tried
SELECT book_title 
FROM books_info
WHERE book_title
LIKE '%" +booktsp+ "%'

and also
SELECT book_title 
FROM books_info
WHERE book_title
LIKE '%'booktsp'%'
Posted
Updated 27-May-20 8:15am
v3

You've tagged this question as MySQL, which means you need to use the CONCAT function to concatenate strings.
MySQL :: MySQL 5.7 Reference Manual :: 12.7 String Functions and Operators[^]
SQL
SELECT book_title 
FROM books_info
WHERE book_title LIKE Concat('%', @SearchValue, '%')
 
Share this answer
 
Try this:
ALTER PROCEDURE [dbo].[spGetFilesForTitle]
	@PartName NVARCHAR(MAX)
AS
BEGIN
   SELECT d.ID, d.Title, f.* FROM Documents d 
   JOIN DiskFile f ON f.DocId = d.ID
   WHERE d.Title LIKE '%' + @PartName + '%'
END
It's what I use ... and it works just fine.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900