boylesg Posted February 11, 2014 Share Posted February 11, 2014 (edited) Is there a deliberate policy of not allowing pasting of text directly into the post window or is there something wrong with my browser settings? Because I have to say it is a PAIN IN THE ARSE not being able to do so. Here is the function being called: function getOverheadDetailsShortkey($DailyDetailsShortkey, $OverheadType, $OverheadHours){ $SQLString = "SELECT * FROM DailyOverheadDetails WHERE DailyDetailsShortkey=".$DailyDetailsShortkey." AND OverheadType='".$OverheadType."' AND Hours='".$OverheadHours."'"; $Shortkey = -1; if ($QueryResult = doDBOp($SQLString, "", "")) {echo "1111111111111111111<br>"; if ($Row = mysqli_fetch_assoc($QueryResult)) {echo "2222222222222222222<br>"; $Shortkey = $Row["Shortkey"]; } }echo "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ<br>";echo $SQLString."<br>";echo $Shortkey."<br>";echo "ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ<br>"; return $Shortkey;} Here is the data in the table: Table: DailyOverheadDetailsShortkey DailyDetailsShortkey OverheadType Hours -------------------------------------------------------------------------------50 107 Website 3.549 107 Vehicle maintenance 0.548 106 Website 3.547 106 Vehicle maintenance 0.546 105 Website 3.5 45 105 Vehicle maintenance 0.5 This is my debug output showing the constructed SQL string. ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZSELECT * FROM DailyOverheadDetails WHERE DailyDetailsShortkey=107 AND OverheadType='Vehicle maintenance' AND Hours='0.5'-1ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ1111111111111111111ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZSELECT * FROM DailyOverheadDetails WHERE DailyDetailsShortkey=107 AND OverheadType='Website' AND Hours='3.5'-1ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ So why is my code and SQL string failing to find the record with DailyDetailsShortkey=107, OverheadType='Vehicle mainenance', Hours='0.5', because it clearly exists. What am I doing wrong? Edited February 11, 2014 by Greg Boyles Link to comment Share on other sites More sharing options...
boylesg Posted February 11, 2014 Author Share Posted February 11, 2014 I can perhaps understand not wanting code pasted into the main window but, with the contents of database table, I had to type it in manually batting against an edit window that kept dumping the cursor back at the home position. Link to comment Share on other sites More sharing options...
justsomeguy Posted February 11, 2014 Share Posted February 11, 2014 What is your doDBOp function doing? Is it checking for MySQL errors? You can thank Invision Power Services for how the forum works. They seem to be pretty good at finding new ways to screw up their software. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now