11
RAZERZ
6y

WHY THE FUCK ISN'T THERE AN OPTION TO QUICKLY JUST FUCKING PRINT A TABLE IN PHP???!!!!

I DON'T WANT TO SIT AND WRITE 50 MORE LINES FOR YOU TO DO SUCH A SIMPLE TASK.

I WANT TO JUST "SELECT * FROM BLABAL" AND PRINT THAT FUCKER IS IT THAT HARD EH?

Comments
  • 3
    The answer to your problem is in the description "PHP"
  • 1
    @maykdev I actually like php, but moments like this and I wonder why I didn't focus more on frontend....
  • 1
    @RAZERZ I'm not a great web developer since I'm more focused on desktop development etc.
    but for web development I like Php as well but for some reason I tend more to asp.net since it can sometimes do more in less time.
  • 7
    <table>
    <?
    for(){
    echo('<tr> <td>'+ $something+ '<><>');
    }
    ?>
    </table>

    Maybe? Dunno im not amazing at php
  • 0
    @BindView I solved the issue, but I'm just ranting about how unnecessarily complicated it was :/
  • 2
    I am pretty sure you can just bind it to a view and then just output it in a lot less than 50 lines.
  • 1
    @JoshBent it'd be less than 20 lines to print the table without using any frame work
  • 1
    @chowdercake theres no reason not to use some sort of mvc though.
  • 0
    @JoshBent to be fair, printing to the DOM is not very mvc
  • 2
    When you want to have work previously done for you, go for a framework/library, not plain language.
  • 2
    Have you found any language where you can fetch from db and print it in a table directly using any built in method/construct? 😁
  • 0
    Sounds like you're repeating yourself. Time to make a function, holmes.
  • 0
    @JoshBent Oh honey... I was exaggerating
  • 0
    @codePatrol I have, I was just pissed on how easy and simple to do a bunch of other mysqli stuff but fetching the cunts took more lines
  • 1
    @BindView I don't see where I would have even remotely implied that printing directly to the DOM is a good idea.
  • 1
    @santartine Did it using a while and if loop :p

    if($result = mysqli_query($con, "SELECT * FROM table_name;")) {

    while($row = mysqli_fetch_assoc($result)) {
    //Table crap goes here

    }
    }
  • 2
    @RAZERZ why mysqli instead of pdo anyway
  • 0
    @JoshBent Heh, not anything which will be used publicly if you know what I mean. It is just a local thing running in a browser so that my boss can manage his crap easier, there is no way he is going to input Robert') DROP TABLE Students;-- (Reference to Bobby tables :p) ;)
  • 0
    @santartine Possibly, but hey, my deadline is Monday so as long as it works I am fine :)
  • 0
    @RAZERZ that's just a poor excuse, honestly.
  • 0
    @JoshBent Shhh, it's not going to be used online. FAKE NEWS
  • 0
    @daegontaven That's what the gov wants you to believe
  • 2
    var_dump($result);

    It's not used online anyway right? 😂😂
  • 0
    @ImNotAlfred Correct 😝 But it's more readable to print_r($result); :)))
    I just print them out in a nice table now but eh
  • 2
    PHP vardumps and print everything already beautiful. HTML is your problem. A enter in HTML does not show up as a enter. - You can do this to see a quick php result.

    <pre> <?php print_r($sql_query_result); ?> </pre>
  • 0
    @sneeuwpopsneeuw I guess you're right.
Add Comment