Jump to content

jazzman1

Staff Alumni
  • Posts

    2,713
  • Joined

  • Last visited

  • Days Won

    12

Everything posted by jazzman1

  1. She means something like that: INSERT INTO tbl_temp2 (fld_id) SELECT tbl_temp1.fld_order_id FROM tbl_temp1 http://dev.mysql.com/doc/refman/5.0/en/insert-select.html
  2. Who knows.....maybe one day
  3. Did you really read seandisanti's reply how to use the implode php function? Is it true ? $ids = implode('ars_no, phone_number, category_1, category_2, status, create_date, resolved_date, trouble_type_priority, ban_type, employee_id_name', $_POST['id']);
  4. Aside of the error that you got above, did you restart the http and the mysql server after upgrading php? BTW - nice Italian family
  5. A beautiful performance and an arrangement too. Enjoy it guys http://www.youtube.com/watch?v=daImufKYrH4
  6. Yes, you can add a nice option to exec command, but why are you using php to do this? Anyway, before do this make sure what permissions has apache to the nice folder. Then create a string like: <?php $nice = 'which nice'; // find where is a nice command in your system $str = "$php_path . ' -c ' . $config_ini . ' mirrors/rapidshare.php ' . $file_uid . ' ' . $status.';'"; $str .="$nice n 5 u $user"; exec($str); // or with a shell_exec() shell_exec($str);
  7. Only one table - check this out. You can google it - how to display hierarchy in php.
  8. Jessi, I understand what you want to say to him, but sometimes the users especially windows one, they messed up php, http, mysql, smtp, etc..... What wrong I said here: He doesn't have to have a web server to execute php scripts and to send emails it has requered an mail server.
  9. Just to be clear: 1. He doesn't have a web server running php scripts, he needs to have only a server for example a linux one. 2. The web server doesn't care about emails only mail server cares of that.
  10. The logic of that function is completly wrong. You can not use it in this way.
  11. You need to use a "=" symbol after the value html attribute.
  12. Well, what charset microsoft exel used for?
  13. Try, CREATE EVENT newEvent ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 DAY DO UPDATE orderrader SET vs=1 WHERE order_datum <= DATE_SUB(NOW(), INTERVAL 14 DAY) ; I've tested that one, it worked to me. CREATE EVENT newEvent ON SCHEDULE AT CURRENT_TIMESTAMP + INTERVAL 1 minute DO UPDATE orderrader SET vs=1 WHERE order_datum <= DATE_SUB(NOW(), INTERVAL 14 DAY) ; I don't know why that one does not work to me. CREATE EVENT newEvent ON SCHEDULE EVERY 1 minute DO UPDATE orderrader SET vs=1 WHERE order_datum <= DATE_SUB(NOW(), INTERVAL 14 DAY) ;
  14. You can create a custom php.ini file, it must called - php5.ini Then, you have to describe which directives of the core php.ini file you want to override. Store this file into your core home directory (to have effect to all websites) or into a specific directory. Next, you need to kill the web processes to get your php5.ini file to take effect. 1. Log in to your Account Manager. 2. Click Web Hosting. 3. Next to the hosting account you want to use, click Launch. 4. In the Stats & Monitors section of the Control Panel in your hosting account, click the System Processes icon. 5. Click End Web and follow any prompts. 6. To check whether your php5.ini file takes effect, open a plain text editor and create a file called phpinfo.php. Insert the following line: <? phpinfo(); ?> We don't know which directive of the new php.ini file has a conflict with your old school php code.
  15. I don't see any reason to set a $_SERVER['HTTP_REFERER'] into the html form. As @davidannis said if the form has been submitted the referer is gonna be set to the email message if not it is gonna be set to null .
  16. Try, // change $Page = $_POST['Page']; to $Page = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : null;
  17. Are you able to see it in your database? SHOW EVENTS;
  18. Ok, let's say that we have the next data in mysql database and all tables are on collation utf8_general_ci. <?php date_default_timezone_set("America/Toronto"); //connect to database define('DB_SERVER', 'localhost'); define('DB_USER', 'jazzman'); define('DB_PASSWORD', 'password'); define('DB_NAME', 'test_database'); $conn = mysql_connect (DB_SERVER, DB_USER, DB_PASSWORD) or die(mysql_error()); mysql_select_db (DB_NAME,$conn) or die(mysql_error()); if(!$conn){ die( "Sorry! There seems to be a problem connecting to our database."); } // set charset to utf8 mysql_set_charset('utf8',$conn); //create query to select as data from your table $select = "SELECT * FROM posts"; //run mysql query and then count number of fields $export = mysql_query ($select) or die ("Sql error : " . mysql_error( )); $fields = mysql_num_fields ($export); //create csv header row, to contain table headers //with database field names for ( $i = 0; $i < $fields; $i++ ) { $header = mysql_field_name( $export , $i ) . ","; } // set empty data array $data = array(); while( $row = mysql_fetch_assoc($export) ) { //$data[] = array($row['title'], $row['body']); $data[] = $row; } echo '<pre>'.print_r($data,true).'</pre>'; /* //create a file and send to browser for user to download header("Content-type: application/vnd.ms-excel"); header("Content-disposition: csv" . date("Y-m-d") . ".csv"); header( "Content-disposition: filename="."test.csv"); print $header."\n". implode(',', $data[0]); exit; */ Results: As you can see from the log file, we have a content with bulgarian, engish and lithuanian characters. Now let's say we want to get only titles and bodies then save them into .cvs file from array #7 this one with lithuanian characters. Sure if you want to save every bodies and titles you need to loop and explode them. I've got this result when I try to open the file into my openOffice software. <?php date_default_timezone_set("America/Toronto"); //connect to database define('DB_SERVER', 'localhost'); define('DB_USER', 'jazzman'); define('DB_PASSWORD', 'password'); define('DB_NAME', 'test_database'); $conn = mysql_connect (DB_SERVER, DB_USER, DB_PASSWORD) or die(mysql_error()); mysql_select_db (DB_NAME,$conn) or die(mysql_error()); if(!$conn){ die( "Sorry! There seems to be a problem connecting to our database."); } // set charset to utf8 mysql_set_charset('utf8',$conn); //create query to select as data from your table $select = "SELECT * FROM posts"; //run mysql query and then count number of fields $export = mysql_query ($select) or die ("Sql error : " . mysql_error( )); $fields = mysql_num_fields ($export); //create csv header row, to contain table headers //with database field names for ( $i = 0; $i < $fields; $i++ ) { $header = mysql_field_name( $export , $i ) . ","; } // set empty data array $data = array(); while( $row = mysql_fetch_assoc($export) ) { $data[] = array($row['title'], $row['body']); //$data[] = $row; } // echo '<pre>'.print_r($data,true).'</pre>'; //create a file and send to browser for user to download header("Content-type: application/vnd.ms-excel"); header("Content-disposition: csv" . date("Y-m-d") . ".csv"); header( "Content-disposition: filename="."test.csv"); print $header."\n". implode(',', $data[7]); exit; Result:
  19. Sometimes I'm using this guide - tested. Instead WHERE User='root', you sould use WHERE User='userName';
  20. What is your operating system?
  21. Tony, I'm agree with you, in that case BASH is gonna be much more suitable and powerful than php.
  22. jazzman1

    Cakephp ACL

    Try to change (just for a test) database driver from 'datasource' => 'Database/Sqlserver' to 'datasource' => 'Database/Mysql'.
  23. Wow.....very strange directories names You don't have to execute shell_exec() every time, just put your logic into a simple string and execute it at once. Something like: <?php $str = 'cd /var/www/trekeffect.com/trekeffect.com;'; $str .='pwd;'; $str .= 'ls -d'; // etc..... //execute the string $dir = shell_exec($str); echo $dir; Don't forget to separate the individual unix commands with semicolon
  24. What will you get: <?php $dir = shell_exec('cd /var/www/trekeffect.com/trekeffect.com;pwd'); echo $dir;
  25. Sorry for delay but I'm working. So, the "deploy" is your working directory on the server not "trekeffect.com"
×
×
  • 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.