• Member Avatar for cereal
    cereal

    Replied To a Post in compare two audio wav files by their voice

    Not simple. Check out **CMUSphinx** and **Julius** projects: * http://cmusphinx.sourceforge.net/ * http://julius.sourceforge.jp/en_index.php Both are open source and provide a **C** API, Sphinx4 provides also a **Java** API. So if you …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Is better store images in a BLOB or in directories?

    You can do a test: load 500 files in a table database, then create a duplicate of this table without the blob field and perform some queries. MySQL provides a …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Query Help

    Hi, in this case you can use a subquery to return all the rows from `user_status`: selecting their `max(status_type)` and `max(status_value)` and grouping by the `user_id`. Then you need a …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Is better store images in a BLOB or in directories?

    Hi, in my opinion, it is better to save the images in directories and the names in a database, mainly because you can serve the images as static content, without …
  • Member Avatar for cereal
    cereal

    Replied To a Post in select value fron query result

    Do you mean you want to select a specific row from a result set? Which API are you using: MySQLi, PDO, MySQL? * http://www.php.net/manual/en/mysqlinfo.api.choosing.php
  • Member Avatar for cereal
    cereal

    Replied To a Post in MySQL syntax error help

    Hi, if you using this query in PHP then this value: $_SESSION (['MM_Username']) Must be: {$_SESSION['MM_Username']} Full query: "SELECT transactions.UserName, transactions.transactionDate, transactions.transactionType, transactions.transactionAmount, transactions.OpeningBalance, transactions.EndBalance, users.FirstName, transactions.transactionID FROM transactions, users …
  • Member Avatar for cereal
    cereal

    Replied To a Post in PHP script backs up MySQL files - need to add delete command

    > What do I need to add or change so that any backups older than the 5 newest gets pruned? In the local or in the backup server? In addition: …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Input Gallery

    Hi, before the undefined index notice there is: > unable to select dataid is empty but this is no where in the above code, it could be related to the …
  • Member Avatar for cereal
    cereal

    Replied To a Post in PHP Nuke as a Web Platform

    > PHP-Nuke 8.3.2 fix some security issues and become compatible with PHP 5.3. By the way, this is not even completely true, most of their filters are based on the …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Web.py and asp/php server files?

    Sorry for the update, I did a little error in my previous post, regarding the alternative to call the PHP executable. The correct version is this: r = check_output(["/usr/bin/env", "php", …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Alternative way of an INSERT with WHERE clause?

    Yes, you can use the linefeed character `\n`: update table1 set color = concat_ws('\n', color, 'lime') where id = XX; **But** from a usable point of view, a comma separated …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Web.py and asp/php server files?

    The correct solution would be to serve web.py as fastcgi together with PHP and ASP, this should be managed by a server as Apache or Nginx. But if you want …
  • Member Avatar for cereal
    cereal

    Replied To a Post in only image which is 150 dpi is upload

    Please provide your code, otherwise it is difficult to help.
  • Member Avatar for cereal
    cereal

    Replied To a Post in Alternative way of an INSERT with WHERE clause?

    Hi! You can use `concat_ws()` to add content to a string, for example: update table1 set color = concat_ws(',', color, 'green') where id = XX; Full example: > create table …
  • Member Avatar for cereal
    cereal

    Gave Reputation to arslanqamar in how to make zip file

    ` Dear cereal you have just small mistake. I have updated the code. try this code. <?php # array of files $files = array( 'profile.txt', 'picture.jpg' ); # name $zipname …
  • Member Avatar for cereal
    cereal

    Replied To a Post in how to make zip file

    **@arslanqamar** thank you for your attention! I see what you meant: header("Content-Disposition:attachment;filename=$zipname"); And you are precisely correct. I chose to use `random_name.zip` instead of the `$zipname` value, to evidence that …
  • Member Avatar for cereal
    cereal

    Replied To a Post in how to make zip file

    Look at the ZipArchive class: * http://www.php.net/manual/en/class.ziparchive.php An example: <?php # array of files $files = array( 'feh.jpg', 'img1.jpg' ); # name $zipname = 'archive.zip'; # create the archive $zip …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Read Mysql data and split to display

    Hi, you could explode by the spaces between the names: $names = explode(' ', $row['name']); echo $names[0]; echo $names[1]; BUT you cannot distinguish between name, middlename and lastname. The correct …
  • Member Avatar for cereal
    cereal

    Replied To a Post in where to get sql dump for countries,cities and states

    I've used this a couple of times: * http://dev.umpirsky.com/list-of-all-countries-in-all-languages-and-all-data-formats/
  • Member Avatar for cereal
    cereal

    Replied To a Post in only image which is 150 dpi is upload

    Hi, I think the OP wants to check if a given image matches the minimum print sizes at a defined DPI: <?php $image = 'img1.jpg'; list($w, $h) = getimagesize($image); $dpi …
  • Member Avatar for cereal
    cereal

    Replied To a Post in echo on same page

    If the undefined index message is related to the `$_POST` variables it is because when you normally open a page you execute a GET request, when you submit the form, …
  • Member Avatar for cereal
    cereal

    Replied To a Post in CodeIgniter using segment urls and query strings

    The first argument of the `anchor()` function can accept an array or a string, so: $segments = array( 'product', 'id', '1', '?version=12&name=mydoc' ); # with array echo anchor($segments, 'click me'); …
  • Member Avatar for cereal
    cereal

    Replied To a Post in CodeIgniter using segment urls and query strings

    I'm not sure I've understood but you can use both at the same time. For example you have a method like this one: public function activation($id) { $data = array( …
  • Member Avatar for cereal
    cereal

    Replied To a Post in show data from database in 10 hours ago

    Sure, `timestapmdiff()` is a function of MySQL that returns the difference between two dates. By the way, there was an error in my previous example, the comparision operator is `<=` …
  • Member Avatar for cereal
    cereal

    Began Watching trying to change ldap password

    I'm trying to change user ldap passwords heres the code $ds = ldap_connect(LDAP_HOST, LDAP_PORT); ldap_set_option($ds, LDAP_OPT_PROTOCOL_VERSION, 3); $bind = ldap_bind($ds, 'uid={admin},'.LDAP_BASEDN, '{admin password}'); $userpassword = "{SHA}" . base64_encode(sha1( '{password}', TRUE …
  • Member Avatar for cereal
    cereal

    Began Watching How to create a separate file system for a individual process

    Hi, I am trying to run a process in my Linux system. For security reason, I want to create separate file systems for each individual process by which some system …
  • Member Avatar for cereal
    cereal

    Replied To a Post in show data from database in 10 hours ago

    Hi, if you're using MySQL then there is the `timestampdiff()` function, for example: select id, title, date from article where timestampdiff(hour, date, now()) =< 10; Docs: http://dev.mysql.com/doc/refman/5.5/en/date-and-time-functions.html#function_timestampdiff
  • Member Avatar for cereal
    cereal

    Replied To a Post in Using Time Zone in Php

    Or the DateTime library: $dt = new DateTime(); $dt->setTimezone(new DateTimeZone('Asia/Kolkata')); echo $dt->format('d/m/Y h:i:s a'); Docs: http://www.php.net/manual/en/class.datetime.php
  • Member Avatar for cereal
    cereal

    Replied To a Post in DNS in PHP

    Then you need something like this: <?php $url = 'domain.com'; $dnsquery = dns_get_record($url, DNS_SRV); $records = array(); $match = '_autodiscover._tcp'; foreach($dnsquery as $key => $entry) { if(strstr($entry['target'], $match) !== FALSE) …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Search #2

    You're welcome! I know, it requires more work and to be precise your script should be modified to use prepared statements, it will help to avoid SQL injections (but [not …
  • Member Avatar for cereal
    cereal

    Gave Reputation to gabrielcastillo in I do not want html escaped

    What about using `htmlspecialchars_decode()` in your textarea [Docs](http://us3.php.net/manual/en/function.htmlspecialchars-decode.php) Example: <textarea rows="" cols="" name=""><?php echo htmlspecialchars_decode($data['content']); ?></textarea>
  • Member Avatar for cereal
    cereal

    Replied To a Post in I do not want html escaped

    **@gabrielcastillo** good suggestion, it could be done when the script receives the POST request, decode the input, filter and send back clean data, at that point there's no need to …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Search #2

    Uhm. I think I cannot help much more, I believe that all these differences happens because, in my case, PDO uses the **MySQL Native Driver**, while yours is probably using …
  • Member Avatar for cereal
    cereal

    Replied To a Post in DNS in PHP

    You could use `getmxrr()`: <?php $url = 'daniweb.com'; getmxrr($url, $matches, $weights); print_r($matches); print_r($weights); Docs: http://php.net/getmxrr Regarding `dns_get_record()` what kind of problem do you experience? Can you show your script? > …
  • Member Avatar for cereal
    cereal

    Replied To a Post in PHP SCREAM Error Maximum Execution Time Exceeded

    Hi, `maximum_execution_time` referes to PHP, so can you paste here the script? Also did you enabled the slow query log in MySQL?
  • Member Avatar for cereal
    cereal

    Began Watching I do not want html escaped

    Hi guys, I am using tinyMCE editor. In my textarea, I want to let user type some html like <table></table> and store that in db just like that, <table></table>. However, …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Trying to extract contents from a word document

    If you can use a plain-text it will be easier, because you can use the `file()` function to read into an array each line of the file, then just loop …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Trying to extract contents from a word document

    Hi, by "word document" are you referring to Microsoft Word file? `doc` or `docx`? Or it is just a plain-text file?
  • Member Avatar for cereal
    cereal

    Began Watching Flush the output buffer in CodeIgniter

    I've tried absolutely everything!! How can I flush the output buffer in CodeIgniter from within either my controller or my view?? They use some weird double/fake output buffer or something. …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Search #2

    Ok, something I wasn't considering: `rowCount()` does not always return the numbers of rows of a select query, this works only for insert, update and delete queries. From the docs: …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Country Dropdown - Loading Country Names From a .txt file?

    In addition, you could use a PHP array, for example create **fruits.php**: <?php return array( 'red' => array( 'Cherries', 'Cranberries', 'Pomegranate', ), 'green' => array( 'Avocados', 'Cucumbers', 'Honeydew', ), 'blue' …
  • Member Avatar for cereal
    cereal

    Replied To a Post in I do not want html escaped

    Hmm, I'm not sure about this. By testing I see what you mean, but I also see that if I resubmit the same form, the allowed tags will be converted …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Search #2

    So, have you tried to force it through the form? Since the charset of the tables is **latin1** you should use `iso-8859-1` instead of `utf-8`: <form name="contact" action="<?php $_SERVER['PHP_SELF'] ?>" …
  • Member Avatar for cereal
    cereal

    Replied To a Post in Search #2

    Can you show the output of: show create table dynamic_content; show create table static_content; It could be a problem of encoding, for example latin1 from your browser and utf8 in …
  • Member Avatar for cereal
    cereal

    Gave Reputation to Dani in Replying to Forum Posts without javascript

    There is now limited ability to reply to articles with javascript disabled in your web browser. However, it's *limited* and semi-broken. I suggest using our mailing list feature.
  • Member Avatar for cereal
    cereal

    Replied To a Post in Zend view displaying multiple times

    Hi, can you show the controller that loads this view?
  • Member Avatar for cereal
    cereal

    Replied To a Post in Rasmus Lerdorf : "All PHP Frameworks Suck"

    Yep: http://talks.php.net/show/phplondon13/ To browse through the slides use the keyboard arrows. **Note** I suggest Firefox to browse them, Chrome seems to not work fine.
  • Member Avatar for cereal
    cereal

    Replied To a Post in 301 Redirect in Htaccess containing parts

    Hi, can you explain it a bit more? If I've understood you want to redirect only certain urls basing on regular expressions, correct? Are these slugs (`now-when`, `an-other`) saved into …
  • Member Avatar for cereal
    cereal

    Replied To a Post in I do not want html escaped

    Look at `valid_elements`: * http://www.tinymce.com/wiki.php/configuration:valid_elements
  • Member Avatar for cereal
    cereal

    Replied To a Post in Search #2

    At line `10` there is an error: if (isset($searching) && $searching==yes) the value `yes` is a string not a constant, so change it to: if (isset($searching) && $searching=='yes') At line …

The End.