Click here to Skip to main content
15,887,746 members

Welcome to the Lounge

   

For discussing anything related to a software developer's life but is not for programming questions. Got a programming question?

The Lounge is rated Safe For Work. If you're about to post something inappropriate for a shared office environment, then don't post it. No ads, no abuse, and no programming questions. Trolling, (political, climate, religious or whatever) will result in your account being removed.

 
GeneralRe: Wordle 456 Pin
Sandeep Mewara17-Sep-22 18:29
mveSandeep Mewara17-Sep-22 18:29 
GeneralRe: Wordle 456 Pin
OriginalGriff17-Sep-22 18:53
mveOriginalGriff17-Sep-22 18:53 
GeneralRe: Wordle 456 Pin
pkfox17-Sep-22 21:28
professionalpkfox17-Sep-22 21:28 
GeneralRe: Wordle 456 Pin
OriginalGriff17-Sep-22 21:53
mveOriginalGriff17-Sep-22 21:53 
GeneralRe: Wordle 456 Pin
jmaida18-Sep-22 14:20
jmaida18-Sep-22 14:20 
GeneralRe: Wordle 456 Pin
pkfox17-Sep-22 21:27
professionalpkfox17-Sep-22 21:27 
GeneralRe: Wordle 456 Pin
Cp-Coder18-Sep-22 4:35
Cp-Coder18-Sep-22 4:35 
GeneralI need to describe the functionality of this code, what it does, it's a challenge but I don't know anything about databases Pin
Vinicius Reis 202217-Sep-22 13:29
Vinicius Reis 202217-Sep-22 13:29 
PHP
<pre><?php
$database = "starter_mag";
$password = "XXXXXXX";
$username = "XXXXXXX";
$hostname = "127.0.0.1";
$link = mysqli_connect($hostname, $username, $password, $database);
if($link === false){
    die("ERROR: Could not connect. " . mysqli_connect_error());
}
$sql = "SELECT distinct TABLE_NAME FROM Information_schema.columns where TABLE_SCHEMA = '$database' ORDER BY table_name  ASC";
$offset = 10000;
if($result = mysqli_query($link, $sql)){
    if(mysqli_num_rows($result) > 0){
        while($row = mysqli_fetch_array($result)){
            $tableName = $row['TABLE_NAME'];
            $count = 0;
            echo '------------------- INIT '.$tableName.' TABLE ---------------'.PHP_EOL;
            do{
                $tableQuery = "SELECT * FROM ".$tableName." limit ".$count*$offset.", $offset";
                if($resultTableQuery = mysqli_query($link, $tableQuery)) {
                    if (mysqli_num_rows($resultTableQuery) > 0) {
                        while ($tableRow = mysqli_fetch_array($resultTableQuery)) {
                            echo ('('.$count.') '.$tableName.': ');
                            echo implode(',',$tableRow);
                            echo PHP_EOL;
                        }
                    }
                }
                $count++;
            }while(mysqli_num_rows($resultTableQuery));
            echo '------------------- END  '.$tableName.'  TABLE ---------------'.PHP_EOL;
        }
        mysqli_free_result($result);
    }
} else{
    echo "ERROR: Could not able to execute $sql. " . mysqli_error($link);
}
mysqli_close($link);


modified 18-Sep-22 5:04am.

GeneralRe: Describe in your own words the operation and output of the code sent: help I'm a beginner in php and I have this challenge Pin
Mike Hankey17-Sep-22 14:05
mveMike Hankey17-Sep-22 14:05 
GeneralRe: Describe in your own words the operation and output of the code sent: help I'm a beginner in php and I have this challenge Pin
Vinicius Reis 202217-Sep-22 23:05
Vinicius Reis 202217-Sep-22 23:05 
GeneralRe: Describe in your own words the operation and output of the code sent: help I'm a beginner in php and I have this challenge Pin
PIEBALDconsult17-Sep-22 14:35
mvePIEBALDconsult17-Sep-22 14:35 
GeneralIt's about to get real! Pin
David O'Neil17-Sep-22 12:29
professionalDavid O'Neil17-Sep-22 12:29 
GeneralRe: It's about to get real! Pin
Ron Anders17-Sep-22 15:33
Ron Anders17-Sep-22 15:33 
GeneralRe: It's about to get real! Pin
RickZeeland17-Sep-22 22:27
mveRickZeeland17-Sep-22 22:27 
Generalworldle 239 3/6 Pin
jmaida17-Sep-22 12:20
jmaida17-Sep-22 12:20 
GeneralRe: worldle 239 3/6 Pin
OriginalGriff17-Sep-22 18:59
mveOriginalGriff17-Sep-22 18:59 
GeneralRe: worldle 239 3/6 Pin
Amarnath S17-Sep-22 20:22
professionalAmarnath S17-Sep-22 20:22 
GeneralRe: worldle 239 3/6 Pin
jmaida18-Sep-22 14:14
jmaida18-Sep-22 14:14 
GeneralThe other song of the weekend, for the older ones ;p Pin
0x01AA17-Sep-22 7:44
mve0x01AA17-Sep-22 7:44 
GeneralRe: The other song of the weekend, for the older ones ;p Pin
Mike Hankey17-Sep-22 8:18
mveMike Hankey17-Sep-22 8:18 
GeneralRe: The other song of the weekend, for the older ones ;p Pin
RickZeeland17-Sep-22 8:52
mveRickZeeland17-Sep-22 8:52 
GeneralRe: The other song of the weekend, for the older ones ;p Pin
Mike Hankey17-Sep-22 10:12
mveMike Hankey17-Sep-22 10:12 
GeneralRe: The other song of the weekend, for the older ones ;p Pin
RickZeeland17-Sep-22 19:58
mveRickZeeland17-Sep-22 19:58 
GeneralRe: The other song of the weekend, for the older ones ;p Pin
Mike Hankey18-Sep-22 1:14
mveMike Hankey18-Sep-22 1:14 
Jokeanother wordle failure Pin
Craig Robbins17-Sep-22 1:18
Craig Robbins17-Sep-22 1:18 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.