[PHP] PHP/mySQL Developer Partner needed...
Greetings, I have a site that I am developing and I am looking to partner/ developer with great php/mySQL skills (for share of potential profits) to assist me in finishing this site. I am looking for someone who can invest (like myself) their time and skills to complete the site in exchange for a percentage of profits the site will make. This is a side project for me, so I am looking for someone who would like to invest 8-10 hours a week to finish this site. To reiterate, I am looking for partner to invest their time and skills. I am not looking to pay someone an hourly wage for the work they do on the site ;-) If you are interested, please contact me PRIVATELY and include a few examples of your work (websites,etc...). Thanks. Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Simple Email System (SES) Provider
Hi all, I built a system in PHP/mySQL where a group of users post events, sign- up for events, change their arrival times, remove thier names from events, and post related notes on the events. Each time an action is done, an email is generated to the entire group that their has been a change. Pretty standard stuff... Today I just got an Mail Delivery System email with this error: Domain dwdcweb.info has exceeded the max emails per hour (350/350 (100%)) allowed. Message will be reattempted later I contacted my VPS provider and they just alerted me that there is a limit on how many emails my server can send per hour. They recommended I find a 3rd party service provider with support PHP API connections. My budget is limited. Does anyone have any suggestions of companies that might work for my scenario? Any feedback is appreciated ;-) Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] passing /n into query ERROR
I have a query below. When I try to run it with PHP it errors: DATABASE_ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'LINES TERMINATED BY '\n'' at line 38 IN BUT where I copy the echoed query and paste into into my Sequel Pro query editor and run it - works perfectly. Can someone shone some light on this? Frustrating - to say the least. Don $csv = SELECT u.user_id, u.first_name AS u_first_name, u.last_name AS u_last_name, c.client_id AS c_client_id, c.first_name AS c_first_name, c.middle_name AS c_middle_name, c.last_name AS c_last_name, c.address AS c_address, c.city AS c_city, c.state AS c_state, c.zip AS c_zip, c.dob AS dob_ymd, c.phone_home AS c_phone_home, c.phone_cell AS c_phone_cell, c.phone_work AS c_phone_work, c.email AS c_email, c.other_contacts AS c_other_contacts, count(*) as apt_qty FROM tl_appt apt JOIN tl_clients c on c.client_id = apt.client_id JOIN tl_rooms r on r.room_id = apt.room_id JOIN tl_users u on u.user_id = apt.user_id WHERE apt.time_start between '.$sd.' and '.$ed.' .$where_sql. GROUP BY u.user_id, c.client_id having count(*) .$aoper. .$aqty. ORDER BY u.first_name, u.last_name, c.last_name, c.first_name INTO OUTFILE '/tmp/.$csv_file..csv' FIELDS TERMINATED BY ',' ENCLOSED BY '\'; LINES TERMINATED BY '.\\n.'; echo $csv; $csv_query = $db-db_query($csv); -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Little Info...
This is a bit related to PHP but mostly mySQL (is there a similar list for this stuff? Let me know please) In my mySQL query editor, I am trying to return a value of 0 when there is no related rows from this query: (select if(count(ip.payment_amount) IS NOT NULL, count(ip.payment_amount) , 0) FROM tl_trans_pmt_items ip WHERE t.transaction_id = ip.inv_id GROUP BY ip.inv_id) as d, regardless of the combination I use, invalid relationships come back as NULL - need to return 0 so I can use it in a math formula. Probably simple - maybe ;-) Thanks, Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Partner needed...
Greetings, I am looking for a partner to help me finish a site and share in profits. The site is PHP/mySQL (using jQuery and jQuery UI). A majority of it is finished. I need to finish up a few more modules. The name of the site is Sport-Hub.com. I would glad to share more about the services the site will provide to the public, but would require a NDA to be signed first. If you have interest in a potential back-end revenue stream in exchange for you time in coding, please contact me PRIVATELY. Thanks! Don Wieland D W D a t a C o n c e p t s -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Convert Hours to Decimal
Hey Tim, I got a select string: select timediff(cast(out_1 as time), cast(in_1 as time)) tHours FROM lm_tc_trans WHERE tc_trans_id = '42' result = 08:45:00 How do i convert that to a FLOAT (5,2) = 8.75 or result = 08:15:00 How do i convert that to a FLOAT (5,2) = 8.25 Don Wieland -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] MP3 Player and PHP
Hello, Can someone recommend a web MP3 player? I need the following options: 1) Location and Duration of mp3 display (seconds) 2) The ability to pass a start and end parameter and play a part of the song 3) Loop parameter 4) Call to the player to grab the mp3 Location and set it to a field so i can insert it via PHP to mySQL 5) Work is most popular browsers Free would be nice but I am will to pay a bit if it offers everything I need. Any suggestions would be appreciated. Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Where is my array?
Hello, I originally had a line that built a static array: $instruments = array('Leader','Singer','Piano','Synth','A-Guitar','E- Guitar','Bass','Drums','Perc','Sax','Flute','Sound/ AV','Pastor','Producer'); Then I decided I wanted this dynamic and to pull it form the DB. So I thought this would bring back similar results: $queryi = SELECT Instrument FROM Instruments WHERE `acct_id` = '. $_SESSION['ACCT'].' ORDER BY `id_Sort`; echo $queryi; $resultsi = mysql_query($queryi) or die(Error performing query); $instruments = mysql_fetch_array ($resultsi); Does not. What am i missing here? Thanks! Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Little Assistance...
Hi all, I am needing to find someone with extensive mySQL chops to assist me in building a few mySQL queries to run from PHP. Compensation, of course... Probably an hour or so of effort for qualified. Please contact me PRIVATELY if interested. Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] mySQL query assistance...
Hi all, Is there a list/form to get some help on compiling mySQL queries? I am executing them via PHP, but do not want to ask for help here if it is no the appropriate forum. Thanks ;-) Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Strange Query Error...
Hi gang, I am executing a query via PHP that gives me a PHP error: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND m.`Preferred_First_Name` LIKE 'Don' AND m.`Preferred_Last_Name` LIKE 'Wielan' at line 1 but when I copy the ECHO of the select query and run it in Sequel Pro Query, it returns no error. Here is the query: select m.* from Members m inner join Member_Years my on m.aucciim_id = my.member_id where now() DATE_ADD(DATE_SUB(concat(`member_year` + 1,'-07-01'), INTERVAL 1 DAY), INTERVAL 30 DAY) AND m.`Preferred_First_Name` LIKE 'Don' AND m.`Preferred_Last_Name` LIKE 'Wieland' group by m.AUCCIIM_ID order by m.preferred_last_name What is causing it to choke via PHP? Thanks! Don
Re: [PHP] Strange Query Error...
On Nov 27, 2010, at 10:07 AM, Bastien wrote: Try removing the backticks around the table names. If you do use them, then all values (field names and table names) need it. I tried that and still chokes... select m.* from Members m inner join Member_Years my on m.aucciim_id = my.member_id where now() DATE_ADD(DATE_SUB(concat(member_year + 1,'-07-01'), INTERVAL 1 DAY), INTERVAL 30 DAY) AND m.Preferred_First_Name LIKE 'Don%' group by m.AUCCIIM_ID order by m.preferred_last_name ERROR: You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'AND m.Preferred_First_Name LIKE 'Don%'' at line 1 Sigh... Don
Re: [PHP] Strange Query Error...
On Nov 27, 2010, at 10:08 AM, Daniel P. Brown wrote: one primary question: are you using the mysql_* family, mysqli_* family, or another method of interfacing with MySQL? mysql_ $results = mysql_query($query) or die(mysql_error()); Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange Query Error...
On Nov 27, 2010, at 10:44 AM, Daniel P. Brown wrote: Note how you keep changing case here. For example, m.aucciim_id vs. m.AUCCIIM_ID. Also note that all of this is cAsE-sEnSiTiVe. You are right. But it still chokes in PHP: select m.* from Members m inner join Member_Years my on m.AUCCIIM_ID = my.member_id where now() DATE_ADD(DATE_SUB(concat(member_year + 1,'-07-01'), INTERVAL 1 DAY), INTERVAL 30 DAY) AND m.Preferred_First_Name LIKE 'Don%' group by m.AUCCIIM_ID order by m.preferred_last_name Don
Re: [PHP] Strange Query Error...
On Nov 27, 2010, at 10:39 AM, Tommy Pham wrote: Don, Have you tried to run the query in either MySQL workbench or the command line to ensure that query is SQL syntax error free? From the error message, it sounds more like a SQL syntax error. If you're able to run the query fine in the workbench or the command line, then it's a possibility there's a bug with the mysql extension which I highly doubt. Yes, Tommy. Works fine in mySQL Workbench Strange... I have no idea what to do. I got to run it via PHP. Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Strange Query Error...
On Nov 27, 2010, at 11:35 AM, Daniel P. Brown wrote: Strange... I have no idea what to do. I got to run it via PHP. Don, on which table is the column `member_year` located? Is that on `Members`? it is Member_Years. I thought of that. I change the query: select m.* from Members m inner join Member_Years my on m.AUCCIIM_ID = my.member_id where now() DATE_ADD(DATE_SUB(concat(my.member_year + 1,'-07-01'), INTERVAL 1 DAY), INTERVAL 30 DAY) AND m.Preferred_First_Name LIKE 'd%' group by m.AUCCIIM_ID order by m.Preferred_Last_Name Still PHP choking and running perfectly in mySQL Workbench. If someone is feeling generous to assist real-time, I am available on SKYPE (skypename = dwdata) and can facilitate a GoToMeeting session. Pretty please - I just want to get this working and move on ;-) Don
Re: [PHP] Strange Query Error...
On Nov 27, 2010, at 12:09 PM, Daniel P. Brown wrote: At this point, can you just send the whole related snippet? The cases keep changing and there's a lot of other suggestions that you said you've tried. Just doing that on my local machine works without error, so it's likely the result of another part of the code --- hence why the query works externally. Thanks Daniel, I did search my code prior to call and found an illegal invisible character. Working now... Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Securing Use of PHP site
Hello all, I have recently built a site using PHP. I was a little loose with GET and POST methods because I was using it for personal/private use. Now I am thinking of going public and allow different companies to use the site. I want to secure and hide as much data as possible to guard against user abuse. I have several instances where I use the GET method to pass IDS. I can use a POST but even that is visible in the source. How does one allow for processing but never really let the user see that actual ID? Do I use a HASH for IDs? Do I need to get more familiar with SESSION VARS. I am doing some experimenting. Any words of wisdom or resources would be helpful. Thanks! Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 336-4828 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html
[PHP] Open Source PHP/ mySQL Project Management
Hi gang, I am looking into Project Management apps for my projects. Any suggestions: I am interested in tracking Projects, Milestones, Tickets, Files, Discussions, Documents, Time Tracking, etc... Also, would like to have the system have robust email integration Reminders, Email Ticket echos (where a user can reply it will post back into the PM system and echo back email to assigned users - with file attachments) Suggestions? Thanks! Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP importing CVS data with field mapping
Hi gang, I have a need to to allow users to import into my web app via PHP. Is there any functions or javascripts out there will allow user to pick a cvs file, bring up a file mapping UI, then process data based on mapping and insert into mySQL DB. Any help or resources would be appreciated. Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Reply to an EMAIL get posted in a mySQL TABLE
Hi gang, I use a Project Management System (PM) that generates emails to my account. I can REPLY to that email and it will be inserted into the PM. I believe the ID is in the subject. I assume the email is sent to a specified email and there is a CRON JOB that runs a PHP script to query and parse the new emails and insert them in to DB. Obviously a cool feature, that I want to use in a few of my web apps. Anyone have any tips/resource links or a product I can use to do this. Any feedback is appreciated! Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Weird Behavior
Little help please ;) $CD = 1287583899 $q1s = 1283313600 $q1e = 1291093200 $q2s = 1291179600 $q2e = 1298869200 $q3s = 1298955600 $q3e = 1306814400 $q4s = 1306900800 $q4e = 1314763200 Why does the following not return the value 1 in the $qCur var // Current Quarter if($CD = $q1s $CD = $q1e) $qCur = 1; if($CD = $q2s $CD = $q2e) $qCur = 2; if($CD = $q3s $CD = $q3e) $qCur = 3; if($CD = $q4s $CD = $q4e) $qCur = 4; it returns 4 Don Wieland -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Firs Day Of Week UNIX
Hi gang, I need a bailout. I have a fields called sys_first_day_of_week and the user can select one value which will be from a menu with these options: Monday Tuesday Wednesday Thursday Friday Saturday Sunday Based on this Preference and TODAYS DATE, I want to calculate the first day of the week. So if my preference is Monday and Today's date is 10/19/2010, I want to return a value of: 1287374400 (which is 10/18/2010) if my preference is Wednesday and Today's date is 10/19/2010, I want to return a value of: 1286942400 (which is 10/13/2010) Appreciate any help. Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 336-4828 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html
[PHP] Firs Day Of Week UNIX
Hi gang, I need a bailout. I have a fields called sys_first_day_of_week and the user can select one value which will be from a menu with these options: Monday Tuesday Wednesday Thursday Friday Saturday Sunday Based on this Preference and TODAYS DATE, I want to calculate the first day of the week. So if my preference is Monday and Today's date is 10/19/2010, I want to return a value of: 1287374400 (which is 10/18/2010) if my preference is Wednesday and Today's date is 10/19/2010, I want to return a value of: 1286942400 (which is 10/13/2010) Appreciate any help. Don
[PHP] Fiscal Years and Quarters
Hello, I have a preference field called Fiscal_Year_Start_Month which has the Month Names as options. Based on this value, I need to calculate the following date in UNIX: Current_1st_Quarter_Start_Date Current_1st_Quarter_End_Date Current_2nd_Quarter_Start_Date Current_2nd_Quarter_End_Date Current_3rd_Quarter_Start_Date Current_3rd_Quarter_End_Date Current_4th_Quarter_Start_Date Current_4th_Quarter_End_Date Last_1st_Quarter_Start_Date Last_1st_Quarter_End_Date Last_2nd_Quarter_Start_Date Last_2nd_Quarter_End_Date Last_3rd_Quarter_Start_Date Last_3rd_Quarter_End_Date Last_4th_Quarter_Start_Date Last_4th_Quarter_End_Date Next_1st_Quarter_Start_Date Next_1st_Quarter_End_Date Next_2nd_Quarter_Start_Date Next_2nd_Quarter_End_Date Next_3rd_Quarter_Start_Date Next_3rd_Quarter_End_Date Next_4th_Quarter_Start_Date Next_4th_Quarter_End_Date Then based on TODAY'S date Current_Fiscal_Quarter - result will be 1, 2, 3,or 4 Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Little Parsing help...
Hello, I am building a web Song DB. That will simple song chord charts in the DB. I would like the ability to do KEY changes for the different songs. I am looking for some direction on how to do this. This was my original thought but I am open if there is a better way. I defined a table called Chords (here is the mySQL Dump): DROP TABLE IF EXISTS `Chords`; CREATE TABLE `Chords` ( `id` int(11) NOT NULL auto_increment, `original_note` varchar(2) default NULL, `up_note` varchar(2) default NULL, `down_note` varchar(2) default NULL, `flatted` varchar(2) default NULL, PRIMARY KEY (`id`) ) ENGINE=MyISAM AUTO_INCREMENT=13 DEFAULT CHARSET=latin1; LOCK TABLES `Chords` WRITE; /*!4 ALTER TABLE `Chords` DISABLE KEYS */; INSERT INTO `Chords` (`id`,`original_note`,`up_note`,`down_note`,`flatted`) VALUES (1,'A','A#','G#',NULL), (2,'A#','B','A','Bb'), (3,'B','C','A#',NULL), (4,'C','C#','B',NULL), (5,'C#','D','C','Db'), (6,'D','D#','C#',NULL), (7,'D#','E','D','Eb'), (8,'E','F','D#',NULL), (9,'F','F#','E',''), (10,'F#','G','F','Gb'), (11,'G','G#','F#',NULL), (12,'G#','A','G','Ab'); /*!4 ALTER TABLE `Chords` ENABLE KEYS */; UNLOCK TABLES; --- now this is a sample of my Music Charts: C Dm7Em This is the first line of my song C/E Em7Dm7 and I know it can get real long Gm7 Am7 If you know I will say G/BC That it will help to ease the day What I was hoping for is to check patterns in the CHORD LINES. I realize I need to mark which lines do PHP will now which line to parse. I was thinking that the user would add a asterisk * at the beginning of the chord line like so: *C Dm7Em This is the first line of my song * C/E Em7Dm7 and I know it can get real long * Gm7 Am7 If you know I will say * G/BC That it will help to ease the day Then have PHP look for occurrences in the lines that begin with an *. So if I want to transpose up 1/2 step, it would look like this: *C# D#m7Fm This is the first line of my song * C#/F Fm7D#m7 and I know it can get real long * G#m7 A#m7 If you know I will say * G#/CC# That it will help to ease the day So if I want to transpose up 1/2 step, it would look like this: *B C#m7D#m This is the first line of my song * B/D# D#m7C#m7 and I know it can get real long * F#m7 G#m7 If you know I will say * F#/A#B That it will help to ease the day I guess the challenge would that once the value was changed, it would not get changed again it same process. Also, I need to make sure that EXACT Case is only changed. For example, there might be a chord like Asus add 9 where I would not want the a of add9 to change. Any suggestions would be appreciated. Don Wieland -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Little Parsing help...
The logic I need is pretty straight forward, but I am having a hard time replicating it using PHP functions. I will try to break it down to it's simplest form: I have a field that has several lines of text. Chords and Song Lyrics. The Chord lines begin with an asterisk * and end with the line break. This is the string I want to parse. Lines with no asterisk at the beginning are ignored. Based on 3 arrays of NOTES, I want SUBSTITUTE the text (based on exact text character patterns - just NOTES not the chord type) of the lines in my field that start with an asterisk *. original_chord_array = A, A#, B, C, C#, D, D#, E, F, F#, G, G# transpose_up_array = A#, B, C, C#, D, D#, E, F, F#, G, G#, A transpose_down_array = G#, A, A#, B, C, C#, D, D#, E, F, F#, G It is important that it only effects EXACT strings. Notes will always be capitalized and chord types will be lower case. Maybe we can use that characteristic to better identify what to change. Here are some examples of chords: A Asus7 Csus add9 Dmaj7 F#m7 G# C#dim no3 When I transpose UP these chords, just the NOTE should change: A# A#sus7 C#sus add9 D#maj7 Gm7 A Ddim no3 When I transpose DOWN these chords, just the NOTE should change: G# G#sus7 Bsus add9 C#maj7 Fm7 G Cdim no3 I am working on a function, but still not producing the proper results. Hopefully this break down is more clear and someone will bail me out ;-) Thanks again for the feedback. Don On Oct 1, 2010, at 7:02 AM, Richard Quadling wrote: Changing the NormalKeyID and using that ID with NoteSequenceNumber should give you the new note to play. I think. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP upload hangs on Safari
Hi, I have a page that has 9 form actions which upload individual files one at a time. On my own server, it runs fine and there are no hangs. But when I install on my clients server. I creased their upload_max_filesize to 100MB. Still I get random hanging. Is there any thing else that I should be looking at to remedy this hanging? Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html
[PHP] Trapping for PDF Type and file size in a UPLOAD form...
I am trying to create an UPLOAD form and need to figure a way to only allow PDF files to be selected. Something like: html body form enctype=multipart/form-data action=upload.php method=post input type=hidden name=MAX_FILE_SIZE value=100 accept=application/pdf / Choose a file to upload: input name=uploaded_file type=file / input type=submit value=Upload / /form /body /html It is documented online that I can pass a parameter ACCEPT=applaction/ pdf, BUT it is not recognized in most browsers. It was suggested by someone that I could trap for this using a JAVASCRIPT. Can someone assist with a snippet of javascript code to trap for this for me? This is the end result I need: If the user selects a file that IS NOT a PDF file, display an javascript alert You can only upload PDF files. Please try again. If the user selects a PDF file greater than 1MB, display an javascript alert File uploads may not exceed 1M in file size. Please try again. I appreciate any help that can be offered. Thanks in advanced! Don Wieland -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] Date Test...
On Jul 8, 2010, at 10:09 AM, Ashley Sheridan wrote: thanks Ash, I figure it out. I was not entering the full year. date('y-m-d',strtotime($fval)) needed to be date('o-m-d',strtotime($fval)) Duh ;-) Thanks, Don On Wed, 2010-07-07 at 13:28 -0700, Don Wieland wrote: Hello all, I am processing an array to build an INSERT string in PHP. The code below I build an a separate array for the TARGET fields and the VALUES. I am trying to trap for a NULL ENTRY in a Date Input Field. Date fields are identified with: $ffield['s']=='/' I tried to add the !empty($fval) to the test but it is giving my an unexpected results. In my case, I have a Data of Birth field that keeps populating in the future: So 1941-06-16 inserts in the DB as 2041-06-16. foreach($form_fields as $ffield){ $fval = is_array($ffield['f'])?joinFields($ffield['s'], $ffield['f']):$_POST[$ffield['f']]; $query_values[] = '.mysql_real_escape_string($ffield['s']=='/' !empty($fval) ?date('y-m-d',strtotime($fval)):$fval).'; } Will anyone point out the problem with this CODE? Don Wieland I can't see anything immediately wrong, but the tertiary operators here mixed in with the mysql_ function and string concatenation don't make for easy reading! Maybe add some brackets to partition things off a bit to make the code easier on the eye. :p Have you tried echo'ing out the queries to see if they actually look well-formed? One place it could fall over is if the values you're using in it aren't well formed. Lastly, you're using a $_POST field directly in your query if the first tertiary if/else fails. You should at the very least validate it to make sure it's in the form you expect, which has to at least be something that can be parsed and processed by strtotime() which you're using in your example. Thanks, Ash http://www.ashleysheridan.co.uk Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html
[PHP] Date Test...
Hello all, I am processing an array to build an INSERT string in PHP. The code below I build an a separate array for the TARGET fields and the VALUES. I am trying to trap for a NULL ENTRY in a Date Input Field. Date fields are identified with: $ffield['s']=='/' I tried to add the !empty($fval) to the test but it is giving my an unexpected results. In my case, I have a Data of Birth field that keeps populating in the future: So 1941-06-16 inserts in the DB as 2041-06-16. foreach($form_fields as $ffield){ $fval = is_array($ffield['f'])?joinFields($ffield['s'], $ffield['f']):$_POST[$ffield['f']]; $query_values[] = '.mysql_real_escape_string($ffield['s']=='/' !empty($fval) ?date('y-m-d',strtotime($fval)):$fval).'; } Will anyone point out the problem with this CODE? Don Wieland -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] NULL Date Entries...
In one of my forms, I am building a variable that I can use as an INSERT string. On my form, I have several DATE fields which exist of 3 fields MM - DD - when I build my string it looks like this: array('dbf'='applicant_dob', 'f'=array('applicant_dob_1','applicant_dob_2','applicant_dob_3'), 'req'=0, 's'='/'), This enters in the DB fine when there is a DATE, but when these fields are left empty, it inserts into the the DB as 2069-12-31. How does one deal with this? Don Wieland -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP - Header ERROR
Hello, I have a contact form with three fields, name, email, and comment, and a CAPTCHA I am doing some basic validation for empty fields but am getting a PHP error when trying to redirect back to the original page with an ERROR, It seems when my COMMENT field contains BRs, it generates the PHP ERROR. No BR?s works perfectly. Am I missing a function for the comment that is necessary for the GET STRING return? if($_POST['name'] AND $_POST['email'] AND $_POST['comment']) { }else{ header(location: contactus.php?Error=Missing values in REQUIRED FIELDSname=.$_POST['name'].email=.$_POST['email'].comment=. $_POST['comment']); exit(); } session_start(); if($_SESSION['Captcha_Str'] != $_POST['scode']) { echo HI; header(location: contactus.php?Error=You did not enter your SECURITY CODE correctly. It is case sensitive.name=.$_POST['name'].email=. $_POST['email'].comment=.$_POST['comment']); exit(); } Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html
Re: [PHP] PHP - Header ERROR
On Jun 13, 2010, at 7:53 AM, Ashley Sheridan wrote: On Sun, 2010-06-13 at 07:50 -0700, Don Wieland wrote: Yeah - I thought about that, but I don't know how to do this. I have a partner who admins my virtual private server. Oh well ;-) It is probably something I need to do to the header() string to accommodate the BRs. I am redirecting back to the original form, displaying an ERROR, then re-populating the fields via the GET string. The omission of this is CHOKING PHP. Don On Jun 13, 2010, at 7:39 AM, Ashley Sheridan wrote: Turn on display_errors in your php.ini, or read the error log. That will show you exactly what your error is, and then if you don't know how to fix that error, post it back here. Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html Add a line in to your .htaccess file then to turn error displaying on. Note that if this is a live server then you shouldn't really do this, but if you have to, turn them back off again asap. php_flag display_errors off When I look at my FTP client, I cannot see this .htaccess file. This is a live server, so I am hesitant to find it anyways. I will wait for my partner to assist me with this config so I can see the error. Unless someone know what I am missing by description. We'll see ;-) ps. please keep the list copied in, as other people might be able to benefit from the thread. OOPS! Sorry, we'll do from now on. Don -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] CSS - Image or object Slide left/right and fade in using jquery
Does anyone have any resources that demonstrates using jquery to have an image or object slide in from the left and then fade in. I would appreciate it. Thanks! Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP and schedules tasks/events
Hi all, I am in need to schedule reminder emails and was wonder how to do this via PHP / mySQL For example, I would like to give my user the ability to sign-up for an event and have an email reminder generated X amount of time before the event. I appreciate any feedback on how to do this... Thanks! Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
Re: [PHP] PHP and schedules tasks/events
On Apr 16, 2010, at 1:26 PM, Bastien Koert wrote: Run a cronjob at midnight and send the email. Track who it got sent to, so you don't duplicate it. Easy peasy! This is fine if the email is to be sent at midnight. I am looking for more refinement. For example: A user signs up for an event - 4/16/2010 @ 10:45am There is an option: Send me a reminder email X minutes/hours/days/weeks/months/years prior to the Event. so: 30 minute(s) = email sent at 4/16/2010 @ 10:15am 2 hour(s) = email sent at 4/16/2010 @ 8:45am 3 day(s) = email sent at 4/13/2010 @ 10:45am 1 week(s) = email sent at 4/9/2010 @ 10:45am 1 month(s) = email sent at 3/16/2010 @ 10:45am 1 year(s) = email sent at 4/16/2009 @ 10:45am This is really what I need... Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Stored Proc - Date not inserting into the Record
I nave 2 stored procedures: DROP PROCEDURE IF EXISTS `Insert_OHC_Sun`; DELIMITER $$ CREATE definer=`do...@`` PROCEDURE `Insert_OHC_Sun`(theDate DATE,theDateRaw INT) BEGIN INSERT INTO Office_Hours_Cuttoff (ohc_Date,ohc_Date_Raw,Office_Status) VALUES (theDate,theDateRaw,Closed); END $$ DROP PROCEDURE IF EXISTS `Insert_OHC_Day`; DELIMITER $$ CREATE definer=`do...@`` PROCEDURE `Insert_OHC_Day`(theDate DATE,theDateRaw INT) BEGIN INSERT INTO Office_Hours_Cuttoff (ohc_Date,ohc_Date_Raw) VALUES (theDate,theDateRaw); END $$ Then I have PHP Code to insert a YEAR of days in a table: if($_POST['new_year']) { //New Year if(in_array($_POST['pick_year'], $ExistingYears)) { $Message = brThe year .$_POST['pick_year']. is already existing.brPlease use the DELETE YEAR feature first. Then ADD the year again.br; } else { //Add Year $first_day = mktime(0,0,0,1, 1, $_POST['pick_year']); $last_day = mktime(0,0,0,12, 31, $_POST['pick_year']); $cDate = $first_day; $num = 1; while($cDate = $last_day) { $nDate = Date('Y-m-d', $cDate); $db-next_result(); if(date('D', $cDate) == Sun) { $db-query(CALL Insert_OHC_Sun({$nDate},{$cDate})); }else{ $db-query(CALL Insert_OHC_Day({$nDate},{$cDate})); } $cDate+=86400; $num++; } } } The records are inserting into the table BUT the field och_Dates is not getting the proper value. It gets -00-00. Frustrating. My code looks right and I echoed the value on the page and it is formatted properly. The field in mySQL is formatted as a DATE type. Little help please :-) Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] PHP / mySQL Project...
Hello, I am needing assistance IMMEDIATELY in finishing up a project (the developer went in to have shoulder surgery and will be out of commission for 3 weeks) and I need this finished soon. Candidate must have good english skills, a solid knowledge of HTML, CSS, PHP, mySQL, Javascript, AJAX, and JQuery. Developer may work remotely. Please contact me via email, PRIVATELY, with your skills and sample of online project you have done. Also, this will be an hourly job - so what Hourly Rate you expect to get paid would be nice. Thanks! Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Weird Array Issue...
Hi, I have defined a stored procedure in my mySQL DB and when I call the procedure in my mySQL browser it returns the CORRECT results: DROP PROCEDURE IF EXISTS `Get_OHC_Years`; DELIMITER $$ CREATE definer=`do...@`` PROCEDURE `Get_OHC_Years`() BEGIN SELECT (YEAR(ohc_Date)) as ohc_year FROM Office_Hours_Cuttoff GROUP BY YEAR(ohc_Date) ORDER BY YEAR(ohc_Date) ASC; END $$ It returns: -- ohc_year-- 2010 2009 2008 2007 I was assuming this will return an array in my PHP when I call it: /** *Get All Office Hours Cut-off YEARS */ $db-next_result(); $years = $db-query(CALL Get_OHC_Years()) or die(Records not found.); $yRow = $years-fetch_array(); echo pre; print_r($yRow); echo /pre; But the result it returns on my page is: Array ( [0] = 2007 [ohc_year] = 2007 What am I missing? Thanks! Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Create Days for a specified YEAR...
Hello, I have a table called tDates in which I stored dates. The field that holds the date is called Day_Date (date result) I need to create a STORED PROCEDURE in mySQL that I can specify the YEAR and it will: Check if any dates in that year are already existing - if so generate a ERROR. If they are not existing, create ONE RECORD for each day in that year. If you can, please include the mySQL procedure code and the PHP that would call it. Appreciate any help that be offered. Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Query based on Server offset TimeStamp
Hello, I have a mySQL database server in Florida USA (EST) and I want to do a query on a record in California, USA (PST) 3 hours earlier using PST instead of EST. I would like to add to my CORE page that offset of the timezone so I can use it in a query like: Select * FROM aTable WHERE ServerOffsetTimeStap = Row_Start_TimeStamp AND ServerOffsetTimeStap = Row_End_TimeStamp How would I do this? Appreciate any help you can offer. Thanks! Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] File To Blob Corruption
Hello, I am trying to create an UPLOAD page to Update a Images and PDFs into a BLOB field in mySQL. The image keeps getting corrupted (it draws a portion of the image and the rest is GRAY) We tried it with Safari and Firefox with bad results. Here is the form that is used to browse and select the file. !-- Upload Image dialog -- div id=uploadImage div id=llback/div centerdiv id=uploadForm div id=uploadTitleUpload Thumbnail image/div iframe name=saveImage/iframe bPlease select the thumbnail image, then press Upload./b div style=margin-top:14px;margin-bottom:14px;text-align:center;width: 100% form target=saveImage method=post action=ajax/saveDialog.php enctype=multipart/form-data Select Thumbnail: input type=file name=img id=img accept=image/ jpeg //div input type=hidden name=obj value=uploadImage / input type=hidden name=id value=?php echo $Area_id ? / input type=button value=Upload onclick=saveDialog('uploadImage','img','jpg'); input type=button value=Cancel onclick=cancelDialog('uploadImage','img') /form /div/center /div Here is the QUERY to upload the image (saveDialog.php): if($_POST['obj'] == uploadImage) { $file = $db-real_escape_string(file_get_contents($_FILES['img'] ['tmp_name'])); $db-query(UPDATE Areas SET Image = '$file') or die(1.$db-error); Has anyone else ever run into this type of UPDATE error with images and PDF? We really need to get this dealt with ASAP. Thanks! Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Suppress Right-Click and Hide hover URL
Hi gang, Is there a javascript to Suppress Right-Click and Hide hover URL? I as trying to get this to work with no luck: a href=\aInlet_Proc_Area.php?id={$row1['id']}proc=delete\ onMouseOver=\javascript:window.status=''; return true;\ onClick= \javascript:return confirm('Are you sure you want to REMOVE the assoication of this Area with this Inlet?')\\Remove/a Please let me know if this can be tweaked to work... Thanks! Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Build Categories based on an static Array
I am trying to build a SELECT MENU (with categories). I cant seem to get the syntax correct. Little help: // Get Areas values for MENU $AreasList = select name=\Area_id\option value=''/option; $queryR = array(0 = 'Domestic','International','Special'); while($rowR = $queryR-fetch_assoc()) { $AreasList .= optgroup label=\{$rowR['Region_Name']}\; $Area_Type = $rowR['Area_Type']; $query2 = SELECT Area_id,Area FROM Areas WHERE `Area_Type`='$Area_Type' ORDER BY Area; $results2 = $db-query($query2) or die(No Area found.); while($row2 = $results2-fetch_assoc()) { $AreasList .= option value='{$row2['Area_id']}'{$row2['Area']}/option; } $AreasList .= /optgroup; } $AreasList .= /select; Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php
[PHP] Function Not Working...Little help
Hello, I am trying to get this function working but it gives me a PHP error (blank page): function Validate_Page_Nav($LastPage, $ErrorPage) { $trimmed = str_replace($staffroot, '', $_SERVER['SCRIPT_NAME']); $resul = $db-query(SELECT * FROM Page_Access WHERE URI = '$trimmed') or die(failed to get access data); $page_access = $resul-fetch_assoc(); $URI_access = explode(,, $page_access['User_Level']); if($_SESSION['Last_Page'] != $LastPage}) { header(location: {$ErrorPage}?message=Unable to update user information.); exit(); } if(in_array($_SESSION['Staff_level'], $URI_access)) { echo Access; exit(); }else{ echo No Access; //header(location: {$ErrorPage}?message=Unable to update user information.); exit(); } } Validate_Page_Nav(user_list.php, user_list.php); There are parts of the code I was trying to debug. Any help would be appreciated. Don Wieland D W D a t a C o n c e p t s ~ d...@dwdataconcepts.com Direct Line - (949) 305-2771 Integrated data solutions to fit your business needs. Need assistance in dialing in your FileMaker solution? Check out our Developer Support Plan at: http://www.dwdataconcepts.com/DevSup.html Appointment 1.0v9 - Powerful Appointment Scheduling for FileMaker Pro 9 or higher http://www.appointment10.com For a quick overview - http://www.appointment10.com/Appt10_Promo/Overview.html -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php