- This topic is empty.
-
AuthorPosts
-
October 16, 2013 at 10:50 am #153204eugenefParticipant
I am newbee and watching your tut is awesome.I really need some serious help as my ass is on stake.I need to finish up a project a accounting model which is screwing me up.Looking for mentor with whom i can really associate.Your help would be of grate gratitude and image saving for me which i will never forget.Need help on following topics-
1-Fetch data from mysql between dates stored in varchar form.
2-session variables
3-problem in login with drop down.
4-Little bit of ajaxI know you must be busy person but
“A friend in need is a friend indeed”Thanks and waiting for your reply
With Best Wishes;October 16, 2013 at 11:33 am #153205__Participant1-Fetch data from mysql between dates stored in varchar form.
dates should be stored in mysql as
DATETIME
, notVARCHAR
.2-session variables
What about them?
3-problem in login with drop down.
What kind of problem?
4-Little bit of ajax
What about it?
,- – – – — – – – — – – – — – – – –
if you really are looking for a “mentor,” why don’t you post an actual question? Describe, in specific terms:
… what you want to accomplish;
… what you have tried already (show us your code!);
… what happened (vs. what you expected to happen).
,- – – – — – – – — – – – — – – – –
if, on the other hand, you’re only looking for someone to do work for you, say so and then you can discuss your job with any interested persons.
October 16, 2013 at 11:40 am #153206eugenefParticipantUsing tigra calender as date picker which fills database table with VARCHAR dates and not date format.If i use dates it records 0000-00-00.So,of-course its recommended to use date in date form but i have to do in that.I tried this ////////date_format(’10-02-2013′,’%m/%d/%Y’)///////SELECT STR_TO_DATE(YourDateColumn,’%d/%m/%Y’)////////SELECT *////////FROM CashbookWHERE STR_TO_DATE(date,’%Y-%m-%d2′) BETWEEN ‘2013-10-13’ AND ‘2013-10-14’
cash.php
`cash.php<?php
include_once('db.php');
$res = mysql_query('SELECT * FROM CashbookMaster ');echo "
Sno
HeadName
Date
Amount
BillNo
BillDate
PaymentMode
BankName
ChequeNo
Remarks
Center
“;
while( $row = mysql_fetch_array($res) )
{
echo “”;
echo “” . $row[‘Sno’] . “”;
echo “” . $row[‘HeadName’] . “”;
echo “” . $row[‘Date’] . “”;
echo “” . $row[‘Amount’] . “”;
echo “” . $row[‘BillNo’] . “”;
echo “” . $row[‘BillDate’] . “”;
echo “” . $row[‘PaymentMode’] . “”;
echo “” . $row[‘BankName’] . “”;
echo “” . $row[‘ChequeNo’] . “”;
echo “” . $row[‘Remarks’] . “”;
echo “” . $row[‘Center’] . “”;
}
echo “”;
?> `
other 3 issues also i will disscuss.plOctober 16, 2013 at 11:50 am #153210eugenefParticipantyes mentor with whom i can discuss share projects and a cup of coffee for a long term benefit
October 16, 2013 at 12:31 pm #153217__ParticipantIf i use dates it records 0000-00-00.
That means that whatever format you are proving the dates in is not valid. MySQL uses the format
YYYY-MM-DD HH:MM:SS
or, in
date()
format, like so:$mysql_date = date( 'Y-m-d H:i:s' );
Second, the
mysql_*
functions are deprecated and should not be used in new projects. I would suggest looking into mysqli or PDO instead.As for your query, this looks like a typo:
WHERE STR_TO_DATE(date,’%Y-%m-%d2′)
Also, please describe what your results are (vs. what you expected).
When sharing code, it’s a good idea to use Markdown to format it as code. Highlight all your code and click on the [Block Code] button above the comment textbox.
For larger amounts of code, it is better to use an external service (pastebin, or make a gist on github, for example).
October 16, 2013 at 1:01 pm #153246October 16, 2013 at 1:12 pm #153247eugenefParticipantthanks traq for your suggestions
my code gives all results with present code where should i change
$res = mysql_query('SELECT * FROM CashbookMaster' );
October 16, 2013 at 1:15 pm #153248eugenefParticipantpl check as i cannot make changes to project online.getting screwed up by this from last 2 days
October 16, 2013 at 1:23 pm #153249eugenefParticipantOctober 16, 2013 at 1:50 pm #153254eugenefParticipantno solu
October 16, 2013 at 2:17 pm #153256eugenefParticipantforum not right 4 me
October 16, 2013 at 5:48 pm #153266__ParticipantI’ve been trying to reply to this, but something’s not working right…
pl check as i cannot make changes to project online.getting screwed up by this from last 2 days
Never do you work on a “live” site. Set up a copy (on another domain, or on your local computer) and experiment there. Only push tested, working code to your live site. Version control (e.g., git) is great also.
my code gives all results with present code where should i change
$res = mysql_query('SELECT * FROM CashbookMaster' );
Is this existing code (the SQL part)? Or something new that you’re writing now? If it’s new, I strongly suggest that you change it to use
mysql
i
orPDO
, and not the deprecated mysql_* functions.As for your query:
SELECT `cols`,`you`,`want` FROM `Cashbook` WHERE `your_date_col` BETWEEN ’2013-10-13′ AND ’2013-10-14′;
Note that, because you’re using a
VARCHAR
field, this query will (incorrectly) return only rows from October 13 (whereas aDATETIME
column will correctly return rows from the 14th also).October 17, 2013 at 4:19 am #153293eugenefParticipanti am using wamp server if you want i can show my codes to u on teamveiwer
October 17, 2013 at 4:24 am #153294eugenefParticipantalternately as i am using tigra calender which fills date in m/d/y format and values shows 00/00/0000 if i choose date type,with varchar goes good.Can you suggest me time and calender code which fills up populates itself the moment a form is opened.
I would be grateful if you check my codes online on wamp thru teamveiwer or any other u haveOctober 17, 2013 at 10:56 am #153318__ParticipantCan you suggest me time and calender code which fills up populates itself the moment a form is opened.
Do you only want the current date? Or is this something that you want the user to be able to edit?
For the latter case, you can use php’s
date
function:$rightnow = date( 'Y-m-d H:i:s' );
For the former, you can simply let MySQL take care of it:
INSERT INTO `your_table`( `datetime_column` ) VALUES( NOW() );
i can show my codes to u on teamveiwer
I don’t use teamviewer (never heard of it before, in fact).
I would be grateful if you check my codes online
I’d be happy to continue to help out with specific problems, but if you’re asking for a full code review, that’s a little much for a forum discussion.
I do offer consulting services; please contact me if you are interested and we can discuss pricing.
-
AuthorPosts
- The forum ‘Back End’ is closed to new topics and replies.