Jump to content

HuntsvilleMan

Members
  • Posts

    28
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

HuntsvilleMan's Achievements

Member

Member (2/5)

0

Reputation

  1. That was a very helpful suggestion for keeping results from ending up in the output stream. Still, I don't see how you came up with the suggestion to use True as an argument. I'm using the documentation (version 5.3.6) of debug_backtrace() at: http://php.net/manual/en/function.debug-backtrace.php Is there a better documentation I should have used? What I'm getting now is understandable but all in one long unformatted string. Is there an option to format it with some structure when sending the string to a text file? Thanks Mike
  2. Can't see how var_export does anything for me. If I know a variable's name I can just write it to a file. I started out thinking something like vr_dump(debug_backtrace()) might be what I needed. Just can't figure out how to get that data written to a file without mesing with the output stream.
  3. Here is what I tried $a = 1; $b = 2; $c = 3; $snapshot = var_export(); echo $snapshot; // will write to file rather than echo when it works I assumed I would see a list of variables ($a, $b and $c) and their values in $snapshot but saw nothing displayed. Keep in mind I may also need the previous program to know how the program got to the point of failure. Thanks
  4. Unfortunately var_dump goes stright to the output stream. What I need is a function that does the same thing by storing to a variable I can then write to a file.
  5. I need to debug a php program. I've tried to use something like: $debuginfo = var_dump(debug_backtrace()); and then write $debuginfo to a text file for later review. The problem I have is that this approach uses the output stream and my program also wants to write to the output stream. Unfortunately, other programs are using the output stream and dumping dignostic data to the outputstream mesess with the state of the program. Is there a way to get a snapshot of variables and calls without interfering with the output stream? Thanks Mike
  6. Thanks for helping this novice get pointed in the right direction. The INTERVAL key word sounds like what I needed. This will be the third query I've written in mySQL. No doubt the nuances of mySQL versions are a big part of what separates experts from a newbee like me. Next time I'll include the mySQL version I'm using - assuming I can find it. Any other rules I violated? Really appreciate the suggestion.
  7. Perhaps someone with more experience can help this novice understand how to write a mySQL query to delete records older than a given day. The table I have been given has has a field named LogDate with dates stored in a 19 character field format as: yyyy-mm-dd hh:mm:ss What I need to do is delete all records older a given archival day which is also in the character format: yyyy-mm-dd No doubt this would be simpler if the dates were in a normal mySQL date field but alas that's not what life handed me. Thanks for suggestions on how to write this query. Mike
  8. I need help getting global persistence variables in a set of php programs that interact like the ones shown below: |------ -----| \ / | Start.php --->Callback.php----> message.php --> | / \ \ / | Remote vendor service---| At present I pass all parameters to startcall.php and it in turn it passes the values as URL parameters to other programs. The problem I have is that the remote vendor request I make truncates long URLs before they come back. They tell me it has something to do with the way URLs get encoded (a chunking issue) and they can’t fix it. To shorten up the URLs I need to find a way to make all parameters I send to start.php become persistent for about 3 minutes and be avaiable to all PHP programs. Session variables don’t seem to be quite what I need so far as I understand. For example, they would be fine to let start.php remember but then the other programs don’t have the values needed. So far the only solution I know of would be for start.php to store all values in a database table and then have the other programs recall the data as needed. Is there a simpler way to get the kind of global persistent variables I need in this php application? Thanks
  9. I am using a Yahoo server to host a php program tha makes http request to a company called Twilio.com. The problem is that Twilio can't accept chunked encoding and so far as I can tell Yahoo doesn't document a way that I can turn of Chunked Encoding off. Is there a php utility that can turn off Chunked Encoding? Thanks
  10. I need help with an INSERT statement. Had it working but then missed some point about how to do it right. The problem is the statement below. $query_status = mysql_query("INSERT INTO nneighbors (kp, pid, aid, mt, vt, ct, cid) VALUES ($kp, $pid, $aid, $mt, $vt, Now(), NULL)"); The test code I'm working with to focus on the problems is below. Really appreciate a suggestion about what I'm messing up. Thanks Mike <?php //this is a short test program that fails $kp = "1"; // key pressed $pid = 2; // person id $aid = 3; // appointment id $mt = "V"; // message type $vt = "D"; // visit type $myD = "rem"; //database $myT = "nne"; //table $myU = "off"; //username $myP = "dat"; //password /* save call completion information*/ $link_status = mysql_connect("mysql", $myU, $myP); if (!$link_status) echo "failed mysql_connect" . "<br />"; /* Insert the values into the table where cid is an AutoIncrement field*/ $database_status = mysql_select_db($myD); if (!$database_status) echo "failed mysql_select_db" . "<br />"; $query_status = mysql_query("INSERT INTO " . $myT . " (kp, pid, aid, mt, vt, ct, cid) VALUES ($kp, $pid, $aid, $mt, $vt, Now(), NULL)"); if (!$query_status) echo "failed mysql_query" . "<br />"; echo "finished"; ?> echo values: kp = 1 pid = 2 aid = 3 mt = V vt = D myD = rem myT = nne myU = off myP = dat failed mysql_query finished Table structure: kp char(1) pid int(11) aid int(11) mt char(1) vt char(1) ct char(19) (note - intentionally stored in charcter format to accomodate other programs that expect charcater data) cid int(11) auto increment
  11. What I am doing with this code is making a request for data from a mySQL database hosted by my ISP (Yahoo Small Business). The result is Microsoft Access fields being appended by the requested data in the mySQL rows. So far as I can tell Yahoo doesn't support an ODBC interface and since it isn't my server I'll need some pointers on how I might do this myself or possibly get Yahoo to offer this service. Maybe I need a better ISP. This ineed to send data back and forth between Microsoft Access and a distant servers is all quite new to me. On a local Firebird server I do have an ODBC interface that makes data access a bit easier. So, what I'm looking for are better solutions to use with applications that exchange data between Microsoft Access and mySQL databases not on my local area network.
  12. Is there a better way to request mySQL data from a Microsoft Access application. The code I've cobbled together with much help is below. My server is Yahoo Small Business. Thanks for any suggestion about better way to do this kind of data request or ideas for making it more secure. It's all new to me. Mike 'Microsoft Access program to call PHP program Set rs_result = MyDB.OpenRecordset("result", dbOpenTable) baseurl = "something.com/php/mydirectory/" CurrentDb.Execute ("DELETE FROM result") 'Remove results from the temporary table url = "https://" + baseurl + "result.php?" _ & "date=" & URLEncode(txtYearFirstDate) _ & "&myDATABASE=" & URLEncode(myDATABASE) _ & "&myTABLE=" & Trim(myTABLE) _ & "&myUSERNAME=" & URLEncode(myUSERNAME) _ & "&myPASSWORD=" & URLEncode(myPASSWORD) Call Application.ImportXML(url, acAppendData) ******************************************************** <?php $myDATABASE = $_REQUEST['myDATABASE']; $myTABLE = $_REQUEST['myTABLE']; $myUSERNAME = $_REQUEST['myUSERNAME']; $myPASSWORD = $_REQUEST['myPASSWORD']; $query = "SELECT * FROM " . $myTABLE; $query .= " WHERE substring(confirm_time,1,10) = " . "'" . $thisdate . "'"; $result = mysql_query($query); /*send back requested data in XML format */ echo '<?xml version="1.0"?>'; echo '<results>'; while ($row = mysql_fetch_array($result, MYSQL_ASSOC)) { echo '<result>'; echo '<person_id>' . $row['person_id'] . '</person_id>'; echo '<appointment_id>' . $row['appointment_id'] . '</appointment_id>'; echo '<confirm_time>' . $row['confirm_time'] . '</confirm_time>'; echo '</result>'; } echo '</results>'; ?> Use CODE tags in the future, thank you.
  13. Wow! thanks for getting me back on the right track. My minor variation on your great suggestion was: $thisdate = "2011-05-29"; $query = "SELECT * FROM " . $myTABLE; $query .= " WHERE substring(confirm_time,1,10) = " . "'" . $thisdate . "'"; As it happened, time was stored as char(19) data so I had to do a character comparison. No way to express how much I appreciate your helpful suggestion. This mystery bogged me down all day. Is a utility that helps cook up these mySQL/PHP expressions once you have the mySQL query worked out. Thanks Mike
  14. I'm trying to figure out how to write a query and something in the WHERE part is my problem. Without the WHERE part the code runs ok. The field "confirm_time" is text values that look like "2001-04-09 12:14:54" Since I only want values back that match all days like "2001-04-09" I tried the substring function Really appreciate suggestion. This has stumpted me all day. Most likely I need to find atutorial on the correct way to use PHP variables in mySQL queries. All suggestions appreciated? Thanks Mike ... $thisdate = "2011-05-29"; $query = "SELECT * FROM " . $myTABLE; $query .= " WHERE substring(confirm_time,1,10) = " . $thisdate; $result = mysql_query($query); ...
  15. Sounds like the best suggestion is to find a more accomodating web hosting service. Till recently all I wrote were desktop applications and now it seem I'm finding more interesting uses for web applications almost every day. Guess I need a web hosting service that gives me more opportunity to explore and try new things. Anyone have experience with a web hosting service that meets that goal? Thanks Mike
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.