Here is a link I think should help in answering your question Raj...link
My Favs,
1. There is no place like 127.0.0.1
2. There are 10 types of people in the world: Those who understand binary and those who don’t.
5. I had a dream… and there were 1’s and 0’s everywhere, and I think I saw a 2!
7. If at first you don’t succeed, call it version 1.0
8. I would love to change the world, but they won’t give me the source code
10. A Life? Cool! Where can I download one of those? (this so applies to me!!!)
12. Windows 98 supports real multitasking - it can boot and crash simultaneously (I have personally experienced this 1)
14. My Software never has bugs. It just develops random features.18. Computers are incredibly fast, accurate, and stupid; humans are incredibly slow, inaccurate and brilliant; together they are powerful beyond imagination. — Albert Einstein
20. I’m not anti-social; I’m just not user friendly
They are funny...lol...:D
I’m not anti-social; I’m just not user friendly
Ok, So I did a little changing in the $sql syntax from
$sql = mysql_query("SELECT * FROM tsttbills where DATE_FORMAT(date, '%d-%m-%Y') >= '$sDate' and DATE_FORMAT(date, '%d-%m-%Y') <= '$eDate'", $conn);
to
$sql = mysql_query("SELECT * FROM tsttbills where DATE_FORMAT(billDate, '%d-%m-%Y') >= '$sDate' and DATE_FORMAT(billDate, '%d-%m-%Y') <= '$eDate'", $conn);
the only problem now is that the data in the csv is not within what i selected....
I have data from only 1 month in the table, and i selected the start date to be the 1st, and the end date to be the 9th, and when i click the button 'Generate' i am getting a csv filled with data from the 10th onwards....
Up To Date
Author: Robert Byers
A 28k modem is slower than fate
A 386 is a paperweight
A 4x CD is not so great
But my love for you is up to date
A 5 inch floppy is hard to find
A 12 inch screen will leave you blind
An all DOS system is way behind
But my love for you is the modern kind
The pace of change is getting faster
The new technology is hard to master
Today's new computer will be out to pasture
But losing you would be real disaster
I can make it fine with my old stuff
So much of the new is merely fluff
I'll never be a technology buff
But since I have you I have enough.
Are you hungering for some chocolate cake but don't want to do all that work or eat all that cake? Here is a recipe for a 5 minute cake that is just the right amount - would use a small bowl in place of the mug but still....
Hey GrimJack,
I tried the recipe, and it came out great....it tasted nice...and it didn't look like the second link you posted there though....
Four men were sitting around a conference room table being interviewed for a job.
The interviewer asked, 'What is the fastest thing you know of?'
The first man replied, 'A thought.' It pops into your head, there's no forewarning that it's on the way; it's just there. A thought is the fastest thing I know of..'
'That's very good,' replied the interviewer.
'And now you, sir,' he asked the second man.
'Hmmm, let me see...... A blink!,' said the second man. 'It comes and goes and you don't know it ever happened. A blink is the fastest thing I know of.'
'Excellent!', said the interviewer. The blink of an eye. That's a very popular cliche for speed.'
The interviewer then turned to the third man who was contemplating his reply.
'Well,' said the third candidate, 'out on my dad's ranch, you step out of the house and on the wall there is a light switch. When you flip that switch, way across the pasture the light at the barn comes on in an instant. Turning on a light is the fastest thing I can think of.'
The interviewer was very impressed with the third candidate's' answer and thought he had found his man.
'It's hard to beat the speed of light.', the Interviewer said.
Turning to the fourth man, he posed the same question.
'After hearing the three previous answers, it's obvious to me the fastest thing known …
Truth hurts--
not the searching after;
the running from!
-- John Virgil
Why is it that when you're driving and looking for an address,
you turn down the volume on the radio?
" Two people meet while walking down the street. Each person has just one dollar in their pocket. After visiting, the two people exchange the dollar and continue on their way. They walk away with one dollar in their pocket. Across the street, two people meet while walking down the street. Each person exchanges an idea. Now those two people walk away with two ideas. Which side of the street would you like to walk on?"
--- Author Unknown
testGCR.php
<?php
error_reporting(E_ALL ^ E_NOTICE);
include("./gcrFunction.php");
if(count($_POST['btnSubmit']) == 0)
{
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Test Document</title>
<script language="javascript" type="text/javascript" src="datetimepicker.js">
//Date Time Picker script- by TengYong Ng of http://www.rainforestnet.com
//Script featured on JavaScript Kit (http://www.javascriptkit.com)
//For this script, visit http://www.javascriptkit.com
</script>
</head>
<body>
<form method="post" target="_blank">
<table>
<tr>
<td width="747">
<p align="left"><span class="style4 style25 style28 style6">Generate Chargeback Report</span></p>
<p align="left"><span class="style21 style29 style5">The Chargeback Reporter works in 2 steps.</span></p>
</td>
</tr>
<tr><td><p> </p></td></tr>
<tr>
<td>
<table width="648" border="0" align="center" cellpadding="1" cellspacing="0" bordercolor="#FFFFFf">
<tr>
<td bgcolor="#99bebe" colspan="4">
<p align="left" class="style8 style7 style32"><strong>
<span class="style21 style33 style11">Step 1: Select Start and End Date</span></strong></p>
</td>
</tr>
<tr>
<td width="100" bgcolor="#99bebe" scope="row">
<div align="left" class="style8 style7 style31 style29 style13">
<div align="right"><strong>Start Date: </strong></div>
</div> </td>
<td width="220" bgcolor="#99bebe">
<input name="sDate" id="sDate" type="text" size="25">
<a href="javascript:NewCal('sDate','ddmmyyyy')">
<img src="images/cal.gif" width="16" height="16" border="0" alt="Pick a Start Date">
</a> </td>
<td width="100" bgcolor="#99bebe" scope="row">
<div align="left" class="style8 style7 style31 style29 style13">
<div align="right"><strong>End Date: </strong></div>
</div> </td>
<td width="220" bgcolor="#99bebe">
<input name="eDate" id="eDate" type="text" size="25">
<a href="javascript:NewCal('eDate','ddmmyyyy')">
<img src="images/cal.gif" width="16" height="16" border="0" alt="Pick an End Date">
</a> </td>
</tr>
<tr>
<td bgcolor="#99bebe" colspan="4">
<p align="left" class="style5">
<span class="style21 style30 style11">Step 2: Generate the Chargeback Report </span></p> </td>
</tr>
<tr>
<td bgcolor="#99bebe"><p> </p></td>
<td bgcolor="#99bebe" colspan="3">
<div align="left">
<strong>
<input type="submit" value="Generate" name="btnSubmit" />
</strong>
</div>
</td>
</tr>
</table>
</td>
</tr>
</table>
</form>
</body>
</html>
<?
}
validateData(); …
. It was a beautiful morning, the birds were chirping away, the wind blew Caroline's hair lightly across her face as they strolled through their large yet heavenly garden towards the lake
Hate it...
Salsa Dance
Unhappy beaver's without their offspring stopped spanking New Zealand polices and failed to annex Australia.
console
Motorolla or Sony Ericsson?
Just relieved to see that the data is consistent. You never really know with a varchar since there really is no structure to keep it in the correct format, you could have had a lot of work ahead of you.
Ok, Well now that the data is consistent, the testGCR.php still doesn't work....
Oho.......I see.......
You should have posted the recipe in the DaniWeb CookBook thread...
:)
R0bb0b, why are you sweating so much:?:
Hey R0bb0b,
I tried your first method, and it worked perfectly....
the date in the database looks like "2007-11-06"
Hi Everyone,
First off, that guy 'link' is a rather ignorant person...very sad!
Secondly, I was doing some light reading a while ago, and thought I'd share this with you all.....
There is a community, a shared culture, of expert programmers and networking wizards that traces its history back through decades to the first time-sharing minicomputers and the earliest ARPAnet experiments. The members of this culture originated the term ‘hacker’. Hackers built the Internet. Hackers made the Unix operating system what it is today. Hackers run Usenet. Hackers make the World Wide Web work.
The hacker mind-set is not confined to this software-hacker culture. There are people who apply the hacker attitude to other things, like electronics or music — actually, you can find it at the highest levels of any science or art. Software hackers recognize these kindred spirits elsewhere and may call them ‘hackers’ too — and some claim that the hacker nature is really independent of the particular medium the hacker works in.
There is another group of people who loudly call themselves hackers, but aren't. These are people (mainly adolescent males) who get a kick out of breaking into computers and phreaking the phone system. Real hackers call these people ‘crackers’ and want nothing to do with them. Real hackers mostly think crackers are lazy, irresponsible, and not very bright, and object that being able to break security doesn't make you a hacker any more than being able to hotwire cars makes you …
Hope you find your answers......and welcome to DaniWeb.....:)
Bulshhhht can be used for manure
No
Were you ever in a physical fight?
I guess we go with option B then. Delete data and import your csv. The date column should be like this,
STR_TO_DATE('13/09/2007', '%d/%m/%Y')
.
Where do I use that?
Is it when I am loading the data into the database from the csv file?........
Chunk of upload code:
if(count($_FILES) > 0)
{
$ext = "";
$ext = substr(trim($_FILES["file"]["name"]), -4);
$allowedext = array(".txt", ".csv", ".sql");
if(in_array($ext, $allowedext))
{
$filename = $_FILES['file']['tmp_name'];
$handle = fopen($filename, "r");
while (($data = fgetcsv($handle, 100000, ',', '"')) !== FALSE)
{
//print_r($data);
//echo("<br />");
$value1 = $data[0];
$value2 = $data[1];
$value3 = $data[2];
$value4 = $data[3];
$value5 = $data[4];
$value6 = $data[5];
$value7 = $data[6];
$value8 = $data[7];
$value9 = $data[8];
$value10 = $data[9];
$value11 = $data[10];
$value12 = $data[11];
//echo("<br />");
$query = "INSERT INTO testtsttbills (account,service,billDate,time,timebandtype,destination,callednumber,mins,airtimecharge,tollcharge,amt,privatenumber) VALUES ('$value1','$value2','$value3','$value4','$value5','$value6','$value7','$value8','$value9','$value10','$value11','$value12')";
$qry = mysql_query($query,$conn) or die("<b>A fatal MySQL error occured</b>.\n<br />Query: " . $query . "<br />\nError: (" . mysql_errno($conn) . ") " . mysql_error($conn));
}
fclose($handle);
echo "<div align='center'><font color='red'>The file was uploaded.</font></div>";
}
else
{
echo "<div align='center'><font color='red'>You are trying to upload an invalid file format. Please try again.</font></div>";
}
}
:S Well......the date in the billDate field were erased and now the column displays 'null' :S .....but on the good side the billDate field datatype is now date...
Folks, I have registered in a class...thanks for your help...
When I ran
update tsttbills set billdate = STR_TO_DATE(billdate, '%d/%m/%Y');
I got the message
Query returned no resultset.
Is that supposed to happen?
Here is the error when I tried the update statement...
the update is taking a while.....*sigh*....i guess it's bcoz of the amount of data i the table...
I changed the name of the field in my table from 'date' to 'billDate'
so should it be:
update tsttbills set billDate = STR_TO_DATE(billDate, '%m/%d/%Y');
ALTER TABLE tsttbills CHANGE `billDate` `billDate` date;
???
:S I have a concern.....the data that is in the table was entered by the previous person working on this proj (I do not know how they got the data into the table)...therefore I created an upload script (this script uploads the data from a csv file and directly into the table...no formatting of the data was done)........now to change the table's date field datatype to 'date' would then also affect the uploading of the data apart from the downloading of the data...am I correct? and if I am, how can I avoid any problems there?
(sorry for back-tracking there....) :S
:-/ I am thinking of formatting the date before it uploads to the standard for mysql.....
not too sure if I am making sense...:icon_redface:
the date format when uploaded is : "dd/mm/yyyy"
the date format from the javascript calendar : "dd-mm-yyyy"
Live now. Make now always the most precious time.
Now will never come again.
-- Captain Jean-Luc Picard, U.S.S. Enterprise