Ranter
Join devRant
Do all the things like
++ or -- rants, post your own rants, comment on others' rants and build your customized dev avatar
Sign Up
Pipeless API
From the creators of devRant, Pipeless lets you power real-time personalized recommendations and activity feeds using a simple API
Learn More
Comments
-
RAZERZ26797y@maykdev I actually like php, but moments like this and I wonder why I didn't focus more on frontend....
-
maykdev4177y@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. -
<table>
<?
for(){
echo('<tr> <td>'+ $something+ '<><>');
}
?>
</table>
Maybe? Dunno im not amazing at php -
RAZERZ26797y@BindView I solved the issue, but I'm just ranting about how unnecessarily complicated it was :/
-
I am pretty sure you can just bind it to a view and then just output it in a lot less than 50 lines.
-
@JoshBent it'd be less than 20 lines to print the table without using any frame work
-
When you want to have work previously done for you, go for a framework/library, not plain language.
-
Have you found any language where you can fetch from db and print it in a table directly using any built in method/construct? 😁
-
RAZERZ26797y@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
-
@BindView I don't see where I would have even remotely implied that printing directly to the DOM is a good idea.
-
RAZERZ26797y@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
}
} -
RAZERZ26797y@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) ;)
-
RAZERZ26797y@santartine Possibly, but hey, my deadline is Monday so as long as it works I am fine :)
-
RAZERZ26797y@ImNotAlfred Correct 😝 But it's more readable to print_r($result); :)))
I just print them out in a nice table now but eh -
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>
Related Rants
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?
undefined
mysqli
sql
table
php