-
Posts
95 -
Joined
-
Last visited
Never
About developerdave
- Birthday 11/18/1988
Contact Methods
- MSN
-
Website URL
http://www.dframewerk.com
Profile Information
-
Gender
Male
-
Location
Chelmsford, United Kingdom
developerdave's Achievements

Member (2/5)
0
Reputation
-
Wow, is it just me or have the moderators got a lot more rude than they used to be? Anyways, I did say that the data set I'm getting returned is completely out of the range I have specified in the query, I tried taking out my order by before as I thought the same but it didn't make the slightest bit of difference. I have just stripped down my query and I've managed to get it selecting the right data set (nearly) This is what I've ended up with so I will have to check the rest of my query. SELECT * FROM `main_table` WHERE ( `date_one` BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 90 DAY) OR `date_two` BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 90 DAY) ) Thanks
-
So I'm having a bit of an issue with a query I'm writing, my table has 2 colulmns with date types and I'm trying to select where either of these dates are between now and 90 days ahead (3 months) but I'm having an issue where it seems to be selecting between now and 2 years ahead. below is my query SELECT * FROM `main_table` WHERE `e_archive` != 1 AND (`date_one` BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 90 DAY) OR (`date_two` BETWEEN CURDATE() AND DATE_ADD(CURDATE(), INTERVAL 90 DAY))) ORDER BY `date_one` ASC The issue is around the OR statement between the 2 BETWEEN queries, if I change it to and I get the right dates but the wrong data returned obviously. Any help is greatly appreciated guys, Dave
-
preg_match like global variable possible?
developerdave replied to developerdave's topic in PHP Coding Help
Ooops my bad, this was simple :s Basically (just to explain) the function assigning the variable is member of a class which is instantiated by another class and returned (for method chaining) and this seemed like a good feature to have so the method chaining wasn't made redundant by having to separate lines for variable assignment. I set the inner class to accept by reference but not the controller All fixed now Thanks anyways guys -
Well i've scoured the PHP.net documentation and Google'd this thoroughly and can't find anything, which suggests it is impossible but I thought I should get a collective opinion on it. So we all know what preg_match() is, its third argument (in most examples is $matches) becomes available to the rest of the script calling that function. What I want to be able to do is say I have a function called foo with the argument $bar I want the variable $bar to become available throughout the rest of my script. Like below. //I don't want to have to do this function foo() { return 'Foobar!'; } $bar = foo();//outputs Foobar! //but rather do this function foo($bar) { return $bar = 'Foobar!'; } echo $bar;//I want it to output Foobar! but doesn't I've tried quite a few thigns now and can't seem to work it out naturally, anyone have any suggestions?
-
mysql populated drop down not $_POST ing data
developerdave replied to gesseg's topic in PHP Coding Help
He has a point, I can't see this amendment in your revised code, perhaps try this? just after the mysql query try echo mysql_error(); And see if there's an error preventing the values being returned to the select field if it has no output, chances are it has no value. -
mysql populated drop down not $_POST ing data
developerdave replied to gesseg's topic in PHP Coding Help
Me too -
mysql populated drop down not $_POST ing data
developerdave replied to gesseg's topic in PHP Coding Help
<form action="insert.php" method="post"> name: <?php $con = mysql_connect("xxx","xxx","xxx"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("xxx", $con); $query="SELECT name FROM band_data2"; /* You can add order by clause to the sql statement if the names are to be displayed in alphabetical order */ $result = mysql_query ($query); echo '<select name="name"> Name</option>'; // printing the list box select command while($nt=mysql_fetch_array($result)){//Array or records stored in $nt echo "<option value=\"{$nt['id']}\">{$nt['name']}</option>"; /* Option values are added by looping through the array */ } echo "</select>";// Closing of list box ?> <br /> skill : <select name="skill"> <option value="">Do they hold their instuments up the right way?</option> <option value="1">1</option> <option value="2">2</option> <option value="3">3</option> <option value="4">4</option> <option value="5">5</option> <option value="6">6</option> <option value="7">7</option> <option value="8">8</option> <option value="9">9</option> <option value="10">10</option></select> <input type="hidden" name="counter" value="1"> <input type="submit" /> </form> Sorry, forum killed it before. I've tidied it up a bit, try wrapping variables contained in string with braces. I'm assuming you're running PHP5? -
You cannot append a query string on a form action, these will not be passed for reference by the form. They need to be post variables in hidden fields for the same effect and the action file to be slightly ammended from $_GET to $_POST to use these variables. Or set the form method to get and ammend the action file to $_GET on all the posted fields. Google 'get variables on post form' and you'll find this (I had to check my facts) http://www.webmasterworld.com/forum88/5383.htm
-
I can't see that working, the PHP should work in the " with no issue I do it all the time. Although spelling method correctly should make all the difference. A post method will not append get variables to the action url. So you need to make these get variables hidden fields with the names of the get variables and set the value accordingly and just change in your scripts the $_GET to $_POST.
-
Mega confused with my .htaccess now
developerdave replied to developerdave's topic in Apache HTTP Server
I solved it by putting a .htaccess in the blog folder and telling it not to rewrite anything back to index.php on root thanks to the cheat sheet on the sticky thread -
Heh, looks like its both then release date of 1.1 isn't for another 10 days or so anyways
-
Well I'm updating my framework at the moment, its to speed up and ease development for learners and designers without compromising on functionality for PHP tech heads. Default will be MySQL but I'd quite like the option to use other technologies. So really its a toss up between using ORM or PDO? What do people think? I'm thinking ORM but I've had a little read on PDO and it seems pretty cool and safe while staying fairly lightweight. (important to me as I've managed to keep the framework to 10-12kb so far )
-
Mega confused with my .htaccess now
developerdave replied to developerdave's topic in Apache HTTP Server
Right, I've fixed everything but I still can't get it to exclude the blog directory and any urls inside that blog I thought this might work, but it doesnt RewriteCond %{REQUEST_URI} !^/(blog)/ before I did the rewrite request to index.php -
Thats ok, I'll just modify the class so its abstract and its a case of drag and drop/defining type after that. So is it worth doing?