Jump to content

shaunie

Members
  • Posts

    52
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

shaunie's Achievements

Member

Member (2/5)

0

Reputation

  1. I have set the parameters in config.yml as this but it's not logging me out after 10 seconds... framework: session: cookie_lifetime: 10 gc_maxlifetime: 10 gc_probability: 1 gc_divisor: 1
  2. Hi, I understand I can use gc_maxlifetime to kill any sessions and logout a user if they have left the browser idle. How do I set this so it can be configured via config.yml?
  3. Thank you, I need to loop through though as there may be more than one product...
  4. Thank you for your reply, the problem seems to be the after after field3 foreach ($result->products->product as $field => $value ) { file_put_contents( '/vardump.txt' , $field . ' = ' . $value , FILE_APPEND ); } produces: field1 = 123 field2 = field3 = but I need field20 value... So I get the error Catchable fatal error: Object of class stdClass could not be converted to string in ...
  5. My apologies, I used this to get the contents of $result var: file_put_contents( '/vardump.txt' , var_export($result, true) , FILE_APPEND );
  6. Hi, I am trying to get the values of field1 and field20 from the following unserialized output: stdClass::__set_state(array( 'id' => 'xxx', 'products' => stdClass::__set_state(array( 'product' => stdClass::__set_state(array( 'field1' => '123', 'field2' => '', 'field3' => stdClass::__set_state(array( )), #various other fields 'field20' => '456', )), )), )) I have tried this code but it doesn't seem to be working, can someone tell me what I am doing wrong here please? $result = unserialize($api->getResponseSerialized()); foreach ($result->products->product as $product) { $product->field1; //doesnt work!!! }
  7. Hi guys, I am setting up a training package based around the Symfony framework. If you have any suggestions on what you think should be included I would love to hear them. Also if you would like to be included on the mailing list when its ready please just drop me a DM
  8. thanks! I have included error reporting and I am indeed having a permissions issue!
  9. Thanks guys, unfortunately the above code doesn't work, which leads me to believe there is a permissions issue. I have even commented out the lines: //unlink($csvfile); //rename($tempfile,$csvfile); and the temp file is not present in that directory...
  10. Thank you, I am using fputcsv() but am having problems writing to the file, I am able to read from it... Could it be a permissions problem?
  11. Thank you, I have updated it so the file is closed for reading and then opened for writing, but it's still not editing the file... if(isset($_POST)){ $row = 1; if (($handle = fopen("customers.csv", "r")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $num = count($data); $row++; for ($c=0; $c < $num; $c++) { // Customer ID exists so edit the record if($data[0] == $_POST['customerId']){ $data[1] = $_POST['name']; $data[2] = $_POST['email']; } } } fclose($handle); } if (($handle = fopen("customers.csv", "w")) !== FALSE) { fputcsv($handle, $data); } }
  12. Thanks I've got this so far but for some reason I am unable to open the file for reading and writing at the same time? if(isset($_POST)){ $row = 1; if (($handle = fopen("customers.csv", "r+")) !== FALSE) { while (($data = fgetcsv($handle, 1000, ",")) !== FALSE) { $num = count($data); $row++; for ($c=0; $c < $num; $c++) { echo '$data[0] = ' . $data[0]; if($data[0] == $_POST['customerId']){ echo 'true'; $data[1] = $_POST['name']; $data[2] = $_POST['email']; } } fputcsv($handle, $data); } fclose($handle); } }
  13. Hi, I have a CSV file with the following columns; id, name, email How can I loop through the file and just update the fields in the row that matches the particular id?
  14. Thanks for your reply, I have managed to convert the date columns (after a lot of hassle!): SUBSTRING(CONVERT(VARCHAR(20), Event.ReportedDateTime, 113), 4, AS [DateReported], My main issue the IF statements which I have attempted to rewrite as CASE Event.Status WHEN 'OPEN' THEN 'OPEN' WHEN 'CLOSED' THEN 'CLOSED' ELSE 'CANCELLED' END also I keep getting errors for not grouping some of the columns: is invalid in the select list because it is not contained in either an aggregate function or the GROUP BY clause
  15. Hi, I'm not sure if this is the best place to ask but I have a query I have written in MySQL, and I need to convert it to MSSQL, does anyone have experience of this? SELECT DATE_FORMAT(DateReported, '%b %Y') AS DateReported, DATE_FORMAT(DateCompleted, '%b %Y') AS DateCompleted, LocationName, IF(status = 'open', 1, 0) AS open, IF(status = 'closed', 1, 0) AS closed, IF(status = 'cancelled', 1, 0) AS cancelled FROM event GROUP BY DATE_FORMAT(DateReported, '%b %Y'), LocationName ORDER BY FIELD(DATE_FORMAT(DateReported, '%M'), 'January', 'February', 'March', 'April', 'May', 'June', 'July', 'August', 'September', 'October', 'November', 'December')
×
×
  • 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.