473,911 Members | 5,861 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

DB Error: mismatch

The following code:

$sql = 'SELECT user_id FROM ' . TC_DATA_NEW_TAB LE_NAME . 'subscribe
WHERE ' .
TC_UTIL::parent Clause($this->getType(), TC_DATA_NEW_TAB LE_PREFIX .
'_type');
$res = $this->_db->query($sql, DB_FETCHMODE_AS SOC); if
(DB::isError($r es)) { die($res->getMessage() . ' [' .
$res->getUserInfo( ) . '] - ' .$res->getDebugInfo () . ' in: ' .
__FILE__ . ' at line nr. ' . __LINE__); }

Generates the following error message:

DB Error: mismatch [SELECT user_id FROM data_newsubscri be WHERE
(tc_datanew_typ e='' OR tc_datanew_type LIKE 'ligfiets' OR
tc_datanew_type LIKE 'ligfiets.links ' OR tc_datanew_type LIKE
'ligfiets.links .thuispagina' )] - SELECT user_id FROM
data_newsubscri be WHERE (tc_datanew_typ e='' OR tc_datanew_type LIKE
'ligfiets' OR tc_datanew_type LIKE 'ligfiets.links ' OR tc_datanew_type
LIKE 'ligfiets.links .thuispagina' ) in:
c:\data\www\be\ technetium\obje cts\www\include \TC_DATA_NEW_MA IL.php at
line nr. 31

Seaching in google gives me lots of the same errormessages, especially
on pages with wiki. The other pages point in the direction of place
holders. In a german newsgroup this error is also discussed (also with
reference to place holders).

I don't use placeholders in the query, zo I don't have any idea how to
solve this problem. Can anybody of you give me please some
suggestions.

Thanks,

Toni
Jul 17 '05 #1
7 11296
Toni wrote:
The following code:

$sql = 'SELECT user_id FROM ' . TC_DATA_NEW_TAB LE_NAME . 'subscribe
WHERE ' .
TC_UTIL::parent Clause($this->getType(), TC_DATA_NEW_TAB LE_PREFIX .
'_type');
$res = $this->_db->query($sql, DB_FETCHMODE_AS SOC); if
(DB::isError($r es)) { die($res->getMessage() . ' [' .
$res->getUserInfo( ) . '] - ' .$res->getDebugInfo () . ' in: ' .
__FILE__ . ' at line nr. ' . __LINE__); }

Generates the following error message:

DB Error: mismatch [SELECT user_id FROM data_newsubscri be WHERE
(tc_datanew_typ e='' OR tc_datanew_type LIKE 'ligfiets' OR
tc_datanew_type LIKE 'ligfiets.links ' OR tc_datanew_type LIKE
'ligfiets.links .thuispagina' )] - SELECT user_id FROM
data_newsubscri be WHERE (tc_datanew_typ e='' OR tc_datanew_type LIKE
'ligfiets' OR tc_datanew_type LIKE 'ligfiets.links ' OR tc_datanew_type
LIKE 'ligfiets.links .thuispagina' ) in:
c:\data\www\be\ technetium\obje cts\www\include \TC_DATA_NEW_MA IL.php at
line nr. 31

Seaching in google gives me lots of the same errormessages, especially
on pages with wiki. The other pages point in the direction of place
holders. In a german newsgroup this error is also discussed (also with
reference to place holders).

I don't use placeholders in the query, zo I don't have any idea how to
solve this problem. Can anybody of you give me please some
suggestions.

Thanks,

Toni


Hi Toni,

Does the database (which one??) accept that SQL-statement anyway?
Did you try to feed it directly by using commandprompt??
To name something:

tc_datanew_type LIKE 'ligfiets.links '

Maybe tc_datanew_type isn't a text/string but a number????
(Just guessing)

You should give more information to us.
Like: What is the definition of the table you are querying?
What database do you use?

My guess is that you use the WRONG DATATYPE in your query.

Regards,
Erwin Moller
Jul 17 '05 #2
Erwin Moller wrote, in respnse to my question:
Generates the following error message:
DB Error: mismatch [SELECT user_id FROM data_newsubscri be WHERE
(...)
Does the database (which one??)
MySQL (version 3.23.49 on the windows machine and 3.23.56 on the linux
box)

accept that SQL-statement anyway?

Yes:

mysql> SELECT user_id FROM data_newsubscri be WHERE (tc_datanew_typ e=''
OR tc_dat
anew_type LIKE 'ligfiets' OR tc_datanew_type LIKE 'ligfiets.links ' OR
tc_datanew
_type LIKE 'ligfiets.links .thuispagina');
+---------+
| user_id |
+---------+
| 1733 |
| 3 |
| 3 |
| 1835 |
| 2219 |
| 3522 |
| 546 |
| 546 |
| 3815 |
| 4023 |
| 13 |
| 2457 |
+---------+
12 rows in set (0.01 sec)

No problem.
Did you try to feed it directly by using commandprompt??
See above.
Maybe tc_datanew_type isn't a text/string but a number????
(Just guessing)
Sorry, I gave to litte information, but you guessed wrong 8-)

CREATE TABLE `data_newsubscr ibe` (
`tc_datanewsubs cribe_id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL default '0',
`tc_datanew_typ e` varchar(255) NOT NULL default '',
`tc_datanewsubs cribe_update` int(11) NOT NULL default '0',
PRIMARY KEY (`tc_datanewsub scribe_id`)
)
You should give more information to us.
Like: What is the definition of the table you are querying?
What database do you use?


Thanks for your efforts.

Sorry, I gave to little information. I hope you (as in the members of
this group) can give me more help with the information I've given
now.

Toni
Jul 17 '05 #3
Toni wrote:
mysql> SELECT user_id FROM data_newsubscri be WHERE (tc_datanew_typ e=''
OR tc_dat
anew_type LIKE 'ligfiets' OR tc_datanew_type LIKE 'ligfiets.links ' OR
tc_datanew
_type LIKE 'ligfiets.links .thuispagina');
+---------+
| user_id |
+---------+
| 1733 |
| 3 |
| 3 |
| 1835 |
| 2219 |
| 3522 |
| 546 |
| 546 |
| 3815 |
| 4023 |
| 13 |
| 2457 |
+---------+
12 rows in set (0.01 sec)

CREATE TABLE `data_newsubscr ibe` (
`tc_datanewsubs cribe_id` int(11) NOT NULL auto_increment,
`user_id` int(11) NOT NULL default '0',
`tc_datanew_typ e` varchar(255) NOT NULL default '',
`tc_datanewsubs cribe_update` int(11) NOT NULL default '0',
PRIMARY KEY (`tc_datanewsub scribe_id`)
)

Hi Tony,

I see only 1 more thing that is strange.
You use LIKE 'blabla' instead of LIKE '%blabla%'

The % means: match anything (before or after the literal string).

Using LIKE and no % is a little meaningless because it means the same as the
= sign.
But I am unsure if it gives an error.
I have never touched MYSQL (I am a postgresql fanatic), but have a look if
that is the source of the error.

Sorry I cannot help you any futher.

Good luck.
If you find the solution, be sure to post it here for others to enjoy. :-)

Regards,
Erwin Moller
Jul 17 '05 #4
Erwin Moller wrote:
I see only 1 more thing that is strange.
You use LIKE 'blabla' instead of LIKE '%blabla%'
I know, this code is in a function that allows the use of wildcards.
But I am unsure if it gives an error.


I never hurts to test, but I don't think it matters since phpmyadmin
uses them in the same way.

DB Error: mismatch [SELECT user_id FROM data_newsubscri be WHERE
((tc_datanew_ty pe = '') OR (tc_datanew_typ e = 'ligfiets') OR
(tc_datanew_typ e = 'ligfiets.links ') OR (tc_datanew_typ e =
'ligfiets.links .thuispagina') )] - SELECT user_id FROM
data_newsubscri be WHERE ((tc_datanew_ty pe = '') OR (tc_datanew_typ e =
'ligfiets') OR (tc_datanew_typ e = 'ligfiets.links ') OR
(tc_datanew_typ e = 'ligfiets.links .thuispagina') ) in:
c:\data\www\be\ technetium\obje cts\www\include \TC_DATA_NEW_MA IL.php at
line nr. 31

Nope, same result. After the change from like to = I also added extra
parentheses, bebause I was unsure about the order of operators. The
message I've included in my post is from that test.

Could this be a bug in either PEAR, PHP or MySQL and do you know
how/where to check this?

Thanks for your efforts,

Toni
Jul 17 '05 #5
Toni wrote:

<snip>

Could this be a bug in either PEAR, PHP or MySQL and do you know
how/where to check this?
Hi Tony,

I think you might be right this is maybe a bug.

I would suggest that you just repost in this group with 'PEAR-DB BUG' in the
subject.
Maybe that will attrack the attention of some PEARDB-guru.
I am out of ideas and am far from a PEARDB-guru.


Thanks for your efforts,

You are welcome.
Toni


Good luck!

Regards,
Erwin Moller
Jul 17 '05 #6
I wrote:
(...)
$res = $this->_db->query($sql, DB_FETCHMODE_AS SOC); if

(...)
Without knowing the second argument is a list of parameters, and not a
way to set the fetchmode. Removed it, and set the fetchmode at the
appropriate place => problem solved.

Sorry for bothering you,

Toni
Jul 17 '05 #7
Toni wrote:
I wrote:
(...)
$res = $this->_db->query($sql, DB_FETCHMODE_AS SOC); if

(...)
Without knowing the second argument is a list of parameters, and not a
way to set the fetchmode. Removed it, and set the fetchmode at the
appropriate place => problem solved.

Sorry for bothering you,

Toni


Glad you found it. :-)

Regards,
Erwin Moller
Jul 17 '05 #8

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

Similar topics

2
2938
by: Stephen Briley | last post by:
For some reason, my posts are scrubbed as attachments. Lets hope that sending from the yahoo account works. I'm new to Python and I'm trying to do some database work with MS Access, but I can't seem to get around a "datatype mismatch error". Here's an example table that I'm working with... ID name dept 1 steve acct
2
2136
by: Steve Briley | last post by:
I'm new to Python and I'm trying to do some database work with MS Access, but I can't seem to get around a "datatype mismatch error".&nbsp; Here's an example table that I'm working with... &nbsp; ID&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; name&nbsp;&nbsp;&nbsp; dept 1&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; steve&nbsp;&nbsp; acct
6
1747
by: DrewM | last post by:
This is a strange request - but I'm trying to generate a Type Mismatch error. It's for an example in some documentation. I was looking for something that would error (like a mathematical equation using a string) that could be simply fixed using CInt(). However, the strings are getting converted at run time so I can't get the error to throw! Any ideas? Drew
5
4451
by: Arun Wadhawan | last post by:
Hello MY SQL Server is causing me this problem : Microsoft VBScript runtime error '800a000d' Type mismatch: 'ident' >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> I am getting from the table datingnew the value of the ident field.
4
11970
by: Mike | last post by:
I am getting a type mismatch error when I do a bulk insert. ---Begin Error Msg--- Server: Msg 4864, Level 16, State 1, Line 1 Bulk insert data conversion error (type mismatch) for row 1, column 14 (STDCOST). ---End Error Msg--- The STDCOST is set to decimal (28,14) and is a formatted in Access as a number, single with 14 decimal. I don't know why I would be getting a Type
19
8393
by: Steve | last post by:
ASP error number 13 - Type mismatch with SELECT...FOR UPDATE statement I got ASP error number 13 when I use the SELECT...FOR UPDATE statement as below. However, if I use SELECT statement without FOR UPDATE, it is fine and no error. I also tried Set objRs = objConn.Execute("SELECT * FROM EMP UPDATE OF EMPNO"), but it still couldn't help. any ideas? I tried to search in the web but couldn't find similar
9
13291
by: Prasad | last post by:
HI, I am a beginner in VC++.. I am trying to write a Win32 console application in visual studio.. I am using following header files.. #include <STRING> using namespace std; #include <hash_map>//from Standard template library //and some other headers
5
2856
by: kjworm | last post by:
Hello Everyone, I have been fighting with a type mismatch error for many hours today and I can't seem to find what the problem is. Hopefully it is more than a missing apostrophe! I have isolated each SQL statement using a MsgBox and then input that exact code as a Query in access which works. I'm using Access 97 on Windows XP. My code is below: Dim strKaizen As String strKaizen = "UPDATE KaizenEvents SET(TeamLeader)= '" & & "' WHERE...
9
1842
by: sara | last post by:
Hi - I have code (below) that ran as recently as Monday. We decided to change the location for the output reports, and now the code errors (13 Type Mismatch) on the query. The query runs fine on its own. The code still runs fine from the .mde. If I undo the change (single line) I STILL get the error. The .mdb compiles fine.
0
1231
by: =?Utf-8?B?ZnJmYWxsYXM=?= | last post by:
Hello, I had an error starting outlook that says my mailbox.pst file is corrupted, I have runned the scanpst tool as te dialog box says, nothing happened, I created other data file named mailbox2.pst and all my curent mails downloaded, I have tried to open my old mailbox.pst to recover old mails but the same problem exist I looked over some sort of a log file with the same mailbox name but with a txt extension, can someone helpme to recover...
0
10038
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9879
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10921
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
11057
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
1
8099
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5940
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
6142
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
4341
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
3360
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 can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.