Jessica
Staff Alumni-
Posts
8,968 -
Joined
-
Last visited
-
Days Won
41
Everything posted by Jessica
-
Did you try?
-
How To Check A ' $_Get ' Value Is 100% String Or Integer?
Jessica replied to Eritrea's topic in PHP Coding Help
A string CAN contain integers. If you want only a-z, use a regex. -
You can't have a foreach in a string. This code will generate errors. You have to add to the string within the loop.
-
Thanks. OP: See the link in my signature for your error.
-
Did you try it?
-
So then loop through the rows and send the emails.
-
How many emails do you want to get? One for each row? Or one containing all the info for every row that matches? And right now, you just told it to email you, with no logic.
-
They need to be a DATE field. Unless you need the time too, then a DATETIME.
-
I doubt that completiondate is the only column you'll need to select, but: SELECT completiondate FROM needs WHERE completiondate = DATESUB(NOW(), INTERVAL 2 DAY)
-
Well, if they are MySQL functions, where do you think you would use them?
-
I said MySQL has the function DATESUB. Not PHP. You clearly looked it up to get the syntax... but then just stuck it in as PHP code?
-
NOW()
-
MySQL has a DATESUB function you can use.
-
Did anyone else read the title as Reindeer? No? Just me? Ok. Your code has no if statement in it, and no logic. What did you try so far? strtotime is a php function, and won't work inside a string like that.
-
If there's no admission number, why would printing it to the screen do any good? Do you understand what your code does? Did you lookup what print_r does?
-
Do you have error reporting on? You'll want to use isset, and sanitize your data. Use print_r to see what was POSTed
-
What are you stuck on? You've already done 1, what's the problem?
-
Jesus. Nevermind. Do it the way that worked. Then go read some basic tutorials.
-
You got an error, and don't show us what it is? I wrote it using my keyboard.
-
$q1_cycle_oil = "SELECT SUM(amount) AS q1_cycle_oil_exp FROM expense_fuel WHERE fuel_code = 017 AND year = $exp_year AND month between 01 and 03"; echo "Query: $q1_cycle_oil "; $q1_cycle_oil_results = mysql_query($q1_cycle_oil) or die(mysql_error()); $row = mysql_fetch_array($q1_cycle_oil_results); echo "result: ".$row['q1_cycle_oil_exp']; print '<pre>'; print_r($row); What do you get?
-
Just run the query. No if/else, just echo the sum!
-
Creating New Array Inside A Foreach Loop And Returning Its Value
Jessica replied to deadliver's topic in PHP Coding Help
No... Did you try the code? -
That makes no sense. Why don't you just echo the sum no matter what it is???