-
Posts
3,372 -
Joined
-
Last visited
-
Days Won
18
Everything posted by Muddy_Funster
-
well it's already an array of values, what exactly are you sending through as $_POST['item_meta'] and why does it go over 125 for what you say could go up to 10?
-
CloudFlare could be worth a look.
-
That's a statement (and not a very good one at that) - not a question. Was there a point to this?
-
Trigger causes insert to say column doesn't exist.
Muddy_Funster replied to sKunKbad's topic in MySQL Help
I can't see anything obviously wrong with the code that's posted. The only thing that I notice is that you're first select to get the user level should have the table identifier in there too: WHERE users.user_id = NEW.user_id But that would throw up a "column user_id in WHERE clause is ambiguous" error if it was causing a problem, not that the column user_id does not exist in d_records. Maybe another member will see something I don't, but I suspect in your attempt to dumb things down for us you may have lost the syntax that is causing the actual issue. -
Please help with database query -- PHP Beginner
Muddy_Funster replied to PNMorrison's topic in PHP Coding Help
the original date string should be just as it always was, you are only using the date objects to check against each other, nothing more, the original output formatting should be unaffected, unless you are overwriting the original date variable, which you can't be doing unless the Date class has the __string() Magic Method in it (which I don't think it does). So it shouldn't matter to your displayed date. Barand said that as long as you are using actual date objects the string format does not matter, that only matters if doing a string comparison as it works left to right by ascii value, so April comes before January (as A is a lower ascii value than J) thus you would need to have the date in the order of Y m d for the correct order to be achieved. Dates can be tricky to get right - especially when going between MySQL, PHP and Javascript. That's why I try to do all my date and ordering work in MySQL and then just push the string value through (hance my lack of experience in PHP date work) -
You're very welcome. We all need another pair of eyes at times, best of luck with the rest of your project. Would you be able to mark the topic as Answered please if you are happy that there is nothing else you need covered on it?
-
Hi blackdl, welcome to PHPFreaks forums. You seem to have missed out the bit where you ask your actual question. The answer to what you did ask is "yeah, I expect someone probably could - if you gave them the relevant information" , but I don't think that's what you really came here to find out
-
You're welcome, glad we could help. Could you mark the thread as Answered if you are happy that there is nothing else to cover?
-
PHP Questionnaires Setup and structure
Muddy_Funster replied to FooKelvin's topic in PHP Coding Help
Each form that is filled in will correspond to one record in the table, it's not a table by itself. You're not really giving us the information that we need to answer the question you seem to be trying to ask. Is the issue presenting the info, capturing the info or storing the info? What information are you looking to store (all of it, not just what's in the form) and where is it coming from? What relationship will this information have to other information that is already stored in your DB? Will you be generating the questions from data in the database or will it just be hard-coded? It's always better to tell us too much than too little, we're not familiar with your project so we need a certain level of information to provide effective replies. -
You also need to work out how to ask a question What's the issue you are having? what's your actual code (not the pseudo you have posted)? What's the expected result and? what's the actual result? What have you tried thus-far? Do you need to check if date2 is "greater than" or do you need to check if date2 is "greater than or equal to" (because you claim one and show the other)? Oh, and welcome to the PHPFreaks Forums
-
alright, I'm guessing ther is a language barrier here, but this line: $urlok = 'http://full-stream.org/{id}-{titleok}.html'; for($i=1; $i<=$nbArticle; $i++; $titleok) { is wrong. What is id? {titleok} should be {$titleok} and a for loop only takes in 3 parameters so $titleok should not be there Other than that, I'm not sure what your question is or why you posted in the regex section.
-
So what you have is an object containing an array of objects, you need to iterate through each level. so: $nameObj = $names->GetResult; foreach($nameObj as $nameArray){ foreach($nameArray as $dataObj){ echo $dataObj->ID; } }
-
I messed that you were unsetting $arr[0], so just change the for loop to start with $i=1 instead of $i=0
-
Well if there's no errors the next thing to try would be to use the full URL in the header call, rather than the referential URL header('Location: http://yoursite.com/folder/members_roster.php');
-
Foreign Keys: Childless rows (NULL values in fk field)
Muddy_Funster replied to doni49's topic in MySQL Help
No they can't, because the table definitions for the parent side of the keys doesn't allow null values in the ID columns, as I mentioned already. This means that the foreign key constraint will refuse the use of a null value in the child because it would break the referential integrity of the FK. -
tweaking the loop slightly should strip your last two lines, and you can add the contents to another array as well as echoing it: $fData = array(); $cnt = count($arr) for($i=0;$i<$cnt-1;$i++) { $items = sscanf($arr[$i], '%d %s %s'); echo $items[1] . '<br>'; $fData[$i][] = $items[1]; } ... var_dump($fData);
-
take the echo out and run the page with the header() again, see if there are any errors then.
-
Did you add the echo after you found that the header call wasn't working or was it always there? echo 'Your roster has been updated! <a href="members_roster.php">Click here</a> to return to your roster.'; //header("Location: members_roster.php"); exit();
-
Alright and where are we with display errors and error reporting? If you're using a hosting provider they commonly have error logging done to a file rather than the screen, which makes sense for public facing websites, but isn't as handy for development work
-
OK, so that covers "what should happen", what I'm asking is "what is actually happening"? Are there any error messages? does it redirect to the wrong location? does it give an empty output? have you got error checking and display errors at full and turned on? At what point does it break down? are the DB queries firing ok? The more verbose you can be with the problem the quicker we can help you find a solution.
-
Define "Not Working" please.
-
why a question mark "?" appears after each text box?
Muddy_Funster replied to EHTISHAM's topic in HTML Help
Absolute cobblers. I'm guessing you have some "Required Field" highlighting CSS that is causing the problem. -
Adding a promo/coupon which redirects to new URL
Muddy_Funster replied to Red100's topic in PHP Coding Help
I think we've been involved with more dates on here today than I've had with my wife! lol To keep the theme you could also add "issued date" and "redeemed date" fields which could help a lot with sales metrics later on. -
Adding a promo/coupon which redirects to new URL
Muddy_Funster replied to Red100's topic in PHP Coding Help
Sure there is. I'm not sure if you want a different page per code or not, but the following is assuming different pages. First thing would be to make sure your DB is setup right so that it includes Offer Code, Status and URL. Then you have your script SELECT the url that is attached to the offer code SELECT url FROM offerTable WHERE offerCode = :oCode AND status = "active" Then sense-check the results to make sure it's a valid code and a valid response from the DB then just use the returned URL to send people where you want them to go. It also completely removes the need for your CASE. Have a bash and let us know how you get on. Note: the Status allows you to enable and disable offer codes, but if you are doing this you would want to set up some form of persistence. -
assuming dt is a date field you just need to add a simple WHERE condition to your SQL $sql = <<<SQL SELECT dt, people, c_fname, c_lname, c_phone, c_notes, code FROM restaurantbooking_bookings WHERE dt BETWEEN CURDATE() AND DATE_ADD(CURDATE() INTERVAL 3 DAY) ORDER BY dt ASC SQL; Edit: Missed that you had posted Barand - damn support calls!