473,506 Members | 16,951 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PEAR DB/MySQL Prepared Statement with LIKE

I need some assistance on how to create a select statement using PEAR
DB or MySQL with the LIKE function.
That is I am looking of how I can get statement like this work.
SELECT * FROM customer WHERE name LIKE '%?'

Jun 21 '07 #1
5 3538
On Jun 21, 3:00 pm, j...@fastermail.com wrote:
I need some assistance on how to create a select statement using PEAR
DB or MySQL with the LIKE function.
That is I am looking of how I can get statement like this work.
SELECT * FROM customer WHERE name LIKE '%?'
require_once('MDB2.php');

$mdb2 = MDB2::singleton('mysql://user:password@host/db');
$mdb2->loadModule('Extended');

$rows = $mdb2->extended->getAll(
'select * from customer where name like ?',
null, array('%bob%'));

Jun 21 '07 #2
On Jun 21, 2:42 pm, petersprc <peters...@gmail.comwrote:
On Jun 21, 3:00 pm, j...@fastermail.com wrote:
I need some assistance on how to create a select statement using PEAR
DB or MySQL with the LIKE function.
That is I am looking of how I can get statement like this work.
SELECT * FROM customer WHERE name LIKE '%?'

require_once('MDB2.php');

$mdb2 = MDB2::singleton('mysql://user:password@host/db');
$mdb2->loadModule('Extended');

$rows = $mdb2->extended->getAll(
'select * from customer where name like ?',
null, array('%bob%'));
Thanks for the info. But currently I am running on PEAR DB. Is there a
way this can be done in PEAR DB or plain MySQL?
Jun 22 '07 #3
jm***@fastermail.com wrote:
On Jun 21, 2:42 pm, petersprc <peters...@gmail.comwrote:
>On Jun 21, 3:00 pm, j...@fastermail.com wrote:
>>I need some assistance on how to create a select statement using PEAR
DB or MySQL with the LIKE function.
That is I am looking of how I can get statement like this work.
SELECT * FROM customer WHERE name LIKE '%?'
require_once('MDB2.php');

$mdb2 = MDB2::singleton('mysql://user:password@host/db');
$mdb2->loadModule('Extended');

$rows = $mdb2->extended->getAll(
'select * from customer where name like ?',
null, array('%bob%'));

Thanks for the info. But currently I am running on PEAR DB. Is there a
way this can be done in PEAR DB or plain MySQL?

The point being that Pear DB is obsolete. See
<http://pear.php.net/package/DB>.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attglobal.net
==================
Jun 22 '07 #4
On Jun 22, 6:56 am, Jerry Stuckle <jstuck...@attglobal.netwrote:
j...@fastermail.com wrote:
On Jun 21, 2:42 pm, petersprc <peters...@gmail.comwrote:
On Jun 21, 3:00 pm, j...@fastermail.com wrote:
>I need some assistance on how to create a select statement using PEAR
DB or MySQL with the LIKE function.
That is I am looking of how I can get statement like this work.
SELECT * FROM customer WHERE name LIKE '%?'
require_once('MDB2.php');
$mdb2 = MDB2::singleton('mysql://user:password@host/db');
$mdb2->loadModule('Extended');
$rows = $mdb2->extended->getAll(
'select * from customer where name like ?',
null, array('%bob%'));
Thanks for the info. But currently I am running on PEAR DB. Is there a
way this can be done in PEAR DB or plain MySQL?

The point being that Pear DB is obsolete. See
<http://pear.php.net/package/DB>.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstuck...@attglobal.net
==================- Hide quoted text -

- Show quoted text -
Thanks to you two, I will migrate to mdb2

Jun 22 '07 #5
..oO(jm***@fastermail.com)
>Thanks to you two, I will migrate to mdb2
What about PDO?

Micha
Jun 24 '07 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
1856
by: Joe Randstein | last post by:
Hi! I now use the DB classes from PEAR with mysql. Do I still have to use addslashes? I ask, because I get some very strange results, I get slashes in front of every " and they get saved in my...
3
2437
by: Ron King | last post by:
When I installed Mandrake 10.0 I thought I had Apache, PHP, and MySQL installed correctly. I could serve web pages, MySQL worked, and when I tried the phpinfo() function, I got a page that looked...
1
2131
by: webguynow | last post by:
I'm trying to build a good DB Layer on top of Pear::DB Are there any forums or knowledge base sites on this direct topic ? I've been using the documentation at:...
1
1459
by: webguynow | last post by:
I'm trying to build a good DB Layer on top of Pear::DB Are there any forums or knowledge base sites on this direct topic ? I've been using the documentation at:...
0
1693
by: phil | last post by:
I am having a problem with the C api with prepared statements, the data recorded in the database does not match the data I am sending. It seems to be some sort of bit shifted version of the data,...
1
2765
by: James | last post by:
Hey everyone, I have a really obscure but impassable problem with a reasonably simple piece of php/PEAR DB/MySQL code When calling several stored procs the first call succeeds, but subsequent...
0
5100
by: Ryan Liu | last post by:
Hi, I downloaded the latest version of mysql 5.0 and its .NET driver, I copied the sample code from mysql 5.0 manual to do use prepared statement in C#. But indeed I got a run time error say...
9
2096
by: Harold Crump | last post by:
Greetings, I have a fairly vanilla PHP web application that stores and retrieves data in a MySQL database. Users will be adding a lot of special characters such as single and double quotes,...
1
2513
by: paulq182 | last post by:
PLEASE HELP ME WITH MY CODE?? import java.sql.*; import java.io.*; class min_filmdb_rel_mysql { public static void main (String args ) throws SQLException, IOException {
0
7218
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7103
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7370
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7021
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5614
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5035
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3188
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1532
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
409
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.