Equal in select does not work as expected

I found a funny behaviour using equal with pdo. I checked several select-statements in phpmyadmin and pdo and the results vary. Has someone a idea whats wrong?

$sql = "select * from fenster where fenster > 'news'"; //works ok $sql = "select * from fenster where fenster < 'news'"; //works ok $sql = "select * from fenster where fenster <= 'news'"; //works ok $sql = "select * from fenster where fenster >= 'news'"; // news is not in result $sql = "select * from fenster where fenster = 'news'"; // news is not in result $stmt = $db->prepare($sql); $stmt->execute();

$feldName = array_keys($stmt->fetch(PDO::FETCH_ASSOC));

while($data = $stmt->fetch()) { var_dump($data); }

-------------Problems Reply------------

I found the reason myself. The $feldName = array_keys($stmt->fetch(PDO::FETCH_ASSOC)); did read the missing row, so it did not show afterwards. So I have to find a workaround.

Category:pdo Views:0 Time:2018-10-09
Tags: pdo

Related post

  • IF statement with OR and NOT operators does not work as expected 2011-11-17

    <?php $param = 'c'; if ($param != 'a' || $param != 'b') { echo 'Param != a OR b'; }else { echo 'Param = a OR b'; } ?> The if statement above does not work as expected because the if will ALWAYS evaluate to TRUE regardless of the value of $param

  • transparent option selection does not work on ms paint 2013-05-28

    the transparent option selection does not work....only every now and then it will work but 99% of the time it does not work....where is the fix for this or do you have a fix.....??? --------------Solutions------------- Hi, 1. Were there any recent ch

  • Windows scripting whcih is working in windows XP does not work as expected in Windows 7 what is the difference with OS which affects scripting? 2014-11-24

    Windows scripting whcih is working in windows XP does not work as expected in Windows 7 what is the difference with OS which affects scripting? Sometimes these finctions lead to crashing of browser or un expected resutls are shown, please help me und

  • Using monthcalendar control, when i select a day and use that as a filter for my SQL it does not work as expected 2010-02-24

    I am trying to use the selectionstart and selectionend attributes from monthcalendar to filter between two login dates in a table. When I chose one single day, this does not work correctly. If i chose the day before and the day after the day in quest

  • Replacing part of innerHTML text of a html select option field within multiple select does not work 2010-12-12

    THE FUNCTION The SelectMultiple function comes up with a pop-up div with checkboxes in it. The checkboxes are built equally to select options and added click event to build up an array. Beacuse there are many select menus on the page there is built a

  • Snipping tool does not work as expected in Windows 8 2012-12-04

    Original title: Snipping tool in Windows 8 How does the Snipping tool work on Windows 8? I am using a second screen with my laptop (laptop has a touchscreen--Sony Vaio). When I click on the Snipping tool, whatever I am viewing gets minimized. Am I su

  • Quicken 2013 Premier does not work as expected 2014-02-04

    Original title: Quicken 2013 Premier and windows 8.1 I have successfully installed Quicken 2013 Premier on my computer running 8.1. It opens fine and then just stops doing anything. I cannot activate the close button. When it first opens it always as

  • Tracfone website does not work as expected 2014-06-18

    Original title: Website Problem Hello .. I'm having a problem with one website. It is tracfone's site. Until I got a new laptop (same brand) in January, I was always able to add minutes on my computer. My previous computer had windows XP on it. Now,

  • MongoDB increment query does not work as expected 2011-12-06

    I am trying to increase post's comment vote in atomic operation so I am trying to upvote post's comment if current username is not exist in DownVoters and UpVoters list of comment.But below query really strangely sometimes works but not always. I hav

  • C# send & receive messages via NetworkStream - simple code but does not work as expected 2012-03-11

    I am trying to write a small C# application that will be able to send and receive encrypted messages in a client/server manner. This MSDN example is pretty close to something I need (just to get the basic functionality) http://msdn.microsoft.com/en-u

  • MSXML node.clode method does not work as expected 2012-03-21

    Using the MSXML2 functions from the "msxml3.dll" library, I'm trying to duplicate sections in an XML document, but it does not work as I expected. Here is the XML: <result> <Target> <Point> <pos dimension="2">60.384005 5.33386

  • PowerPoint Office 2007 presentation selection does not work 2012-04-20

    I can open a PowerPoint presentation but the "Present" icon and "Presentation" selection from the View menu does not work (I cannot do presentation). What can I do? Must re-install MS Ofice 2007 from scratch? --------------Solutions------------- Hi S

  • Network selection does not work in roaming 2012-05-06

    Hi, In India while you move from state to another, one has to select a network he wants to get connected. Same service provider is generally available in all the locations. Previously in Nokia E72, the mobile used to get connected to most preferred n

  • CTRL key does not work as expected 2012-11-04

    Original title: Keyboard Help!!! There is a recurring issue going on with my keyboard or most likely my pc... ***Well first to start off with - I use a "ventrilo" type software called "mumble" which uses the key 'CTRL' as a key to speak with others w

  • DataTrigger does not work as expected 2009-11-23

    I have a ComboBox bound to a ViewModel property called Property. Property is a TypeDescriptor. When user changes the value in the ComboBox, the Property is updated. On the UI i would like to either hide or make visible different controls: textbox, co

  • Why one-to-many does not work as expected in NHibernate? 2010-09-27

    I have very simple situation and really don't have a clue why this isn't working. This is my schema: **[item]** id (PK) symbol **[item_version]** id (PK) item_id (FK->ITEM) symbol These are my mappings: item.hbm.xml <class name="Core.Model.Enti

  • Fetching events in specified time interval using Event Kit does not work as expected 2011-04-01

    I am using Event Kit on iOS 4.3.1 to retrieve all of the events in a specified time interval. However, I am experiencing the following problems. 1) using as start date [NSDate distantPast] and as end date [NSDate distantFuture] does not return any ev

  • .click() on image does not work as expected 2011-04-28

    I am attempting to alert some text when an image is clicked. javascript code: $(document).ready(function() { $(".delRow").click('function() { alert("hello!"); }); }); html code: <img src="../images/delete.png" alt="delete" class="delRow"></i

  • Facelet Tag Library mechanism does not work as expected 2012-01-26

    I'm unable to pack taglibrary in a war file. I moved tags from project to extra library the current project is depending now. I put the taglibrary file into the META-INF directory of the jar containing tags (how is described here). But the page does

  • jQueryUI autocomplete 'select' does not work on mouse click but works on key events 2012-03-21

    JS/JQuery: $this.find('input').autocomplete({ source: "/autocomplete_tc_testcasename", minLength: 2, focus: function(e,ui){ $(this).val(ui.item.label); return false; }, select: function(e, ui) { console.log("Selected: "+ui.item.value); } }); CSS: .ui

  • What to use for .live() in the future? .delegate() does not work as expected 2012-03-27

    as I read, the jquery .live() method will not be available in the future. I have a function, which triggers a click for Dom inserted html: $('.post_headl span').live( "click", function(){ alert('###'); }); This works fine. With .delegate() it does no

  • php exec does not work as expected 2012-04-12

    My system: Ubuntu 11.10, LAMP Stack. Issue: I run the following in terminal and it does the back up correctly. mysqldump -u root dbBugTracker > BAK/dbw.sql But I include it in my php code like the following and it does NOT work. exec('/usr/bin/mys

  • Adapter does not work as expected 2012-06-18

    Original title: wierd problem with my adapter ? hello , so I found some relatively similar problems but , tried all solutions and problem is the same so my network is enabled no packages in or out ? no details about my connection what so ever as you

  • activity does not work as expected when it calls from an input method service 2015-02-18

    i have a activity about login twitter which works fine when i run it directly but when i call it from a input method service it does not work ...why? below is my activity code : public class PostTwitter extends Activity { private Button btnLogin; /**

Copyright (C) dskims.com, All Rights Reserved.

processed in 0.211 (s). 11 q(s)