bsamson
Members-
Posts
150 -
Joined
-
Last visited
Everything posted by bsamson
-
How to convert user entered date to MySQL date to compare ...
bsamson replied to bsamson's topic in PHP Coding Help
For Example ... I tried this but it doesn't seem to work: <?php $reqdate = "2008/01/19"; $query = mysql_query("SELECT * FROM nightly WHERE date('Y/m/d',strtotime(entrydate)=$reqdate"); ?> Any Suggestions? -
How to convert user entered date to MySQL date to compare ...
bsamson replied to bsamson's topic in PHP Coding Help
Ok one more question. Let's say I make the user (via a form) enter the date the way MYSQL datetime field. So let's say I want to query the DB to match the date 2008/01/19 ... how to I write that to just search for the date? So basically disregard the entered time? Thanks. -
How to convert user entered date to MySQL date to compare ...
bsamson replied to bsamson's topic in PHP Coding Help
Thanks for everyones help. I just wish there was an easier way ... like a built in function to check only the date. Oh well, thanks everyone! -
Hello ... I currently have a date field in my MySQL DB and ofcourse that's stored in this format: 2008-01-19 12:32:50 The format the end user enters the date is: 01/19/2008 which is stored in $reqdate (i.e.: mm/dd/yyyy) I currently have this MySQL query ... <?php $query = mysql_query("SELECT * FROM nightly WHERE entrydate='$reqdate'"); ?> Obviously this doesn't work. How do I rewrite the above query to check the end user date against the mysql formated date? Any help will be very much appreciated! Thanks!
-
EXACTLY! Expression web was inserting the BOM .... I had to change the encoding of the page to ISO. THANKS for everyone's help!
-
Found it! Expressoion Web was inserting:  ... Thanks everyone
-
I have a screnshot attached [attachment deleted by admin]
-
No honestly ... there is nothing before ... Here's all the php: <?php if ($_POST['acode'] !== "h7p3bf83" || $_GET['add'] !== "y") { header('Location: http://www.mydomain.com/ext/'); } else { // Do Nothing } // http://www.mydomain.com/ext/?acode=h7p3bf83 if ($_GET['add'] == "y") { include "doadd.php"; } if (empty($msg1)) { if ($_GET['add'] !== "y") { $num = $_POST[num]; switch ($num) { case "3060": $location="Brunswick"; break; case "1881": $location="Buffalo"; break; case "8885": $location="Burlington"; break; case "1781": $location="Colonie"; break; case "2378": $location="Concourse"; break; case "7003": $location="Coxsackie"; break; case "1033": $location="Eastfield"; break; case "2812": $location="Elmira"; break; case "7111": $location="Glens Falls"; break; case "0039": $location="Hampshire"; break; case "9600": $location="Holyoke"; break; case "0242": $location="Latham"; break; case "1030": $location="North Pearl"; break; case "6282": $location="Queensbury"; break; case "9900": $location="Rutland"; break; case "1223": $location="Vestal"; break; case "6611": $location="Watertown"; break; case "0100": $location="Western"; break; case "0921": $location="Wilton Mall"; break; case "1200": $location="Liverpool"; break; default: $location="NF"; } } if ($location !== "NF") { $msg = "<b><center>ADD $location to database? <a href='add.php?add=y&loc=$location'>YES</a> or <a href='index.php'>NO</a></b></center>"; } else { $msg = "<b><center>LOCATION NOT FOUND! <a href ='index.php' title='Try again'>Try Again?</b></center>"; } } ?> URL WHEN THIS ERROR OCCURS: http://www.mydomain.com/ext/add.php
-
I just removed the space ... the code was: <? if ($_POST['acode'] !== "h7p3bf83" || $_GET['add'] !== "y") { header('Location: http://www.nexgenstores.com/ext/'); } else { // Do Nothing } ?> With Error: Warning: Cannot modify header information - headers already sent by (output started at /home/myusername/public_html/ext/add.php:1) in /home/myusername/public_html/ext/add.php on line 4 NOW, with code: <? if ($_POST['acode'] !== "h7p3bf83" || $_GET['add'] !== "y") { header('Location: http://www.nexgenstores.com/ext/'); } else { // Do Nothing } ?> Get this error: Warning: Cannot modify header information - headers already sent by (output started at /home/nnyserve/public_html/ext/add.php:1) in /home/nnyserve/public_html/ext/add.php on line 3
-
I understand when/how HEADERS ... I use them all over my site ... that's why this has me so stumped. Thanks though!
-
What I posted is all the code that's processed. That IF statement is at the top of the script before anything is displayed. The HTML Form Page is just a simple page w/ 2 fields and the submit button. The code posted is the beginning of the script. Just by looking @ that do you see any problems?
-
Getting the follow error: Warning: Cannot modify header information - headers already sent by (output started at /home/myusername/public_html/ext/add.php:1) in /home/myusername/public_html/ext/add.php on line 4 With this code: <? if ($_POST['acode'] !== "h7p3bf83" && $_GET['add'] !== "y") { header('Location: http://www.mydomain.com/ext/'); } else { // Do Nothing } ?> I am utterly confused! I understand what this error is, however I do not understand why this script is triggering this. This script processes the result of a HTML form. Anything stick out? Thanks in advance for any help! PS: In this example this error is loading without the "?add=" switch. This error is displaying on the first run.
-
Alright ... have a slight problem I have an internal site for the company i work for. Every night all stores go to this web interface and goto "BREAKDOWN" to report some info at the store level. I have that form working and saving all info in the DB. Now, every night that information needs to be emailed to 3 managers. I can create a PHP script to display the info on a page within the site ... however I need that info emailed to these people everynight @ midnight. I understand I have to create a CROn job to accomblish this ... but I do not know how to create this email script! Please any help would be GREATLY appreciated! ---------------------------------------- By the way, this information HAS to be included in the email ... in other words it cannot just email a link to the page. Thanks!
-
I actually simplified the fields a bit ... that table has 15+ fields. The ID number I was speaking of is not actually an ID number but a store # that's stored in another DB and is stored in a session. I wasn't sure what the MYSQL query would look like is all. Thanks again and have a GREAT weekend!
-
LOL DUH ... I'm sorry for the stupid follow up ... I am obviously still learning PHP & MySQL and the one thing I always find is that I go through and find a very long way to accomplish something that PHP could do in one line of code. HAHA .. Thanks again for everything!
-
Thanks! But here's the thing ... What if I want to specify the ID #? How would I narrow the search by the ID # first ... Then by the date? Thanks for your patience!
-
Actually I just adjusted the date field in my date column to the DATETIME format and adjusted the script accordingly. that being said lets say I wanted to select the most recent date with ID # 5 ... How would I do this? Thanks for all your help!
-
yes I am sorry ... I need to select the newest for a particiular ID #. For example if I want ID #5 ... there are muliples entries for the ID ... So I need to find the newest or latest entry ...
-
Perhaps I am a bit confused. I need to find the date closest to todays. How do I select the closest date and also specify the ID# I want ?? Thanks for any help!
-
I have a DB and I am trying to find a way in php/mysql to grab the field w/ the most current date ... Fields: idno date info Values: 2 04/25/07 info goes here 3 04/26/07 info goes here In this case I would like to grab the ID # and info from IDNO 3. How would I do this? Thanks!
-
Thanks. Just one more thing ... Here's the situation: Users enter a page and enter the last 4 of their phone number. I have a DB w/ this info. So for example: Field: Phone Contents: 123.456.7890 If a user enters "7890" I need to create a query that finds the above field. How do I go about doing this? Thanks again in advance!
-
Alright I have searched and searched. So here goes ... $number = "123.456.7890" I need to grab "7890". So: $lastfour = "7890" How do I do this? Thanks in advance!
-
Hello, I am very much new to Javascript. I have a form which is double checked for accuracy before submitting. This is my code (in the head): <script language="javascript" type="text/javascript"> <!-- // Hide the following code from non-Javascript enabled browsers function focus() // Define function focus { document.breakdown.sprintnew.focus(); } function checkme() // Define function checkme { if (document.breakdown.depositmade.value == "y") { if (document.breakdown.depositMOfrom.value == "mth" || document.breakdown.depositDYfrom.value == "day" || document.breakdown.depositMOto.value == "mth" || document.breakdown.depositDYto.value == "day") { alert("Please check your Deposit Date Range!"); document.breakdown.depositMOfrom.focus();return(false) } if (document.breakdown.deposit.value == "") { alert("Please check your Deposit Amount!"); document.breakdown.deposit.focus();return(false) } } } </SCRIPT> Now, the problem is ... well ... it doesn't work! I have double checks all of my field names and values to be sure it correspondes. All those match up so perhaps there must be a problem in code. As it stands it allows the form to be submitted w/ the incorrect values. any suggestions?
-
Hello, Here's the situation. I have a table w/ 1 entry w/ only 3 fields ID | password | update 01 | blahblah | 09/01/2007 I just want to grab the password and update from that. This is how I am currently doing it (please dont laugh) $query = "SELECT * FROM incpassword"; $result = mysql_query($query); while ($row=mysql_fetch_array($result)) { $grabpswd = $row['password']; $grabdate = $row['update']; } Is there an easier way to assign a variable to those 2 values w/o having to use while. Especially considering there is only 1 entry and only 3 fields. Thanks in advance for any assistance! --Brian
-
Alright. I have searched and googled and cannot seem to find the answer. Perhaps I am not wording it right. But here's the issue. Table: stores Location1 25 Location2 10 Location3 15 How do I write a MySQL query to find the largest # (in this case is location1) Thanks for any assistance! Best Regards, Brian