Jump to content

Alex_isback

New Members
  • Posts

    6
  • Joined

  • Last visited

Alex_isback's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hello everyone I use Curl and php 7, is it possible while unloading data view only last result and delete the previous ones (ob_flush())? example: Clear everyone except last for ($i=0;$i<count($str[1]);$i++) { //echo "\rScaricamento in corso... [Pagina#". ($z+1)."/".$pages." - Foto#".(++$u)."/".$pagesnum[1]."]"; if (!file_exists($folder.'_'.$u.'_'.$images.'.jpg')) file_put_contents($folder.'_'.$u.'_'.$images.'.jpg', get('https://m.media-amazon.com/images/M/'.$str[1][$i].$str[2][$i].'jpg')); echo "[Pagina#".($z+1)."/".$pages." - Foto#".($u)."/".$pagesnum[1]."]" . ' <b style="color:red;">Processing....images</b>&nbsp;&nbsp;' ; ob_flush(); # http://php.net/ob_flush flush(); # http://php.net/flush sleep(1); # http://php.net/sleep }
  2. It only works with this trick SELECT movies.movieid, movies.title, movies.year, movies.imdbid, CAST ( SUBSTRING ( movies.title FROM '#(\d+)\.\d+' ) AS INT ) AS major, CAST ( SUBSTRING ( movies.title FROM '#\d+\.(\d+)' ) AS INT ) AS minor FROM movies WHERE movies.title ILIKE ('%$risultato%') ORDER BY major, minor and inserting this without any reference with the field (number, it does not exist in the query) <td><?php echo $row->numero; ?></td> in datatables "order": [[ 3, "asc" ]], Only in this way orders correctly, But I don't understand the logic, since the number does not exist 🙄 anyway thanks 😉 result
  3. this? <td><?php echo $row->major.'.'.$row->minor?></td> How do I unite the two Row values?
  4. Warning: pg_query(): Query failed: ERROR:The substring_index function (Character Varying, Unknown, Integer) does not exist line 19: Order by Substring_index (title, '#', -1) +0; ^ Hint: no function found with name and types of topics provided
  5. Hi everyone, this is my first post I state that I am not a programmer, only passion and desire to learn. I would need help, PostGresql and PHP use. In this query I should extract the number from the title, after asterisk # SELECT movies.movieid, movies.title, movies.year, movies.imdbid, CAST ( SUBSTRING ( movies.title FROM '#(\d+\.\d+)' ) AS DECIMAL ) AS numero // FROM movies WHERE movies.title ILIKE ('%$risultato%') ORDER BY numero ASC I use Cast and Decimal (perhaps it is wrong) and Substring to extract the number, and is extracted and put in a field of name number (numero) The problem is to order everything in natural order example: 1.1 1.2 1.9 etc.. 1.10 etc.. This is the result of the query, without ordering in the number (numero) field
×
×
  • 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.