I have the PDO connection tutorial in my PHP playlist - th-cam.com/video/wMm2lUoMe6k/w-d-xo.html And I have a whole MySQL playlist - th-cam.com/video/a9W7OpS4LfI/w-d-xo.html Eventually I will get back to the PHP list and add more PDO stuff but can't say when.
How do you get to apply 'foreach' to make all names printed in a different colour. I have a phpmailer array with several error messages but my page is dark and they default to black.
@@SteveGriffith-Prof3ssorSt3v3 Hey Steve, I've managed to apply css to the 'echo' command in another php document successfully but that wasn't an array. If I try to add tags and use style="", the page implodes! I'll mess around with this some more. PHP is pretty unforgiving! Thanks for your quick response...
@@chome4 Don't use inline style properties in your HTML. stick to using CSS class names. Modifying my example from the video: foreach($assoc as $key => $name){ echo '' . $name . ''; } You just have to make sure your quotation marks are properly matched.
sir, how can i store an array of data (into a new table in the DB) from the result of a query? I already have this: $result=mysqli_query($con,$query); It displays the correct rows of information. But I want to store thar new information into a new table in the DB. How to do it? I used while loop (because i just couldnt figure out how to do using foreach loop) but only 1 row is inserted into the table. I wonder why. Here's my while loop: while($row=mysqli_fetch_assoc($result){...$query= "INSERT INTO...} . It insert only 1 row. Further to it, the DB duplicates everytime i refresh the browser. Im stuck....
The while loop can be used to do this as long as you are not closing the connection. Are you using a transaction? Are you committing the transaction? Have you considered using a VIEW or a Stored Procedure to copy the data?
Thank you for making this vedio. Your voice is so smooth!
Superb Sir, I just have clear my doubts, Now seeking foreach() for 2D arrays.
Taking Fight_Club Values was Awesome!!
just wow, associative array and foreach always confuses me, thank u learned soo much
Steve Rogers= "I understood that (fight club) reference!"
Thanks, was really clear. Nice video!
thank youuuu
Useful video
Awesome tutorial, will you also cover pdo insert, update and viewing data in the future?
I have the PDO connection tutorial in my PHP playlist - th-cam.com/video/wMm2lUoMe6k/w-d-xo.html
And I have a whole MySQL playlist - th-cam.com/video/a9W7OpS4LfI/w-d-xo.html
Eventually I will get back to the PHP list and add more PDO stuff but can't say when.
@@SteveGriffith-Prof3ssorSt3v3 can't wait for more pdo stuff
ty!!
thanks nice tutorial
How do you get to apply 'foreach' to make all names printed in a different colour. I have a phpmailer array with several error messages but my page is dark and they default to black.
That is a CSS issue not a PHP one. In a webpage or email the colour is controlled by CSS
@@SteveGriffith-Prof3ssorSt3v3 Hey Steve, I've managed to apply css to the 'echo' command in another php document successfully but that wasn't an array. If I try to add tags and use style="", the page implodes! I'll mess around with this some more. PHP is pretty unforgiving! Thanks for your quick response...
@@chome4 Don't use inline style properties in your HTML. stick to using CSS class names.
Modifying my example from the video:
foreach($assoc as $key => $name){
echo '' . $name . '';
}
You just have to make sure your quotation marks are properly matched.
@@SteveGriffith-Prof3ssorSt3v3 OK thanks. Echo commands now given classes.
sir, how can i store an array of data (into a new table in the DB) from the result of a query? I already have this: $result=mysqli_query($con,$query); It displays the correct rows of information. But I want to store thar new information into a new table in the DB. How to do it? I used while loop (because i just couldnt figure out how to do using foreach loop) but only 1 row is inserted into the table. I wonder why. Here's my while loop: while($row=mysqli_fetch_assoc($result){...$query= "INSERT INTO...} . It insert only 1 row. Further to it, the DB duplicates everytime i refresh the browser. Im stuck....
The while loop can be used to do this as long as you are not closing the connection.
Are you using a transaction? Are you committing the transaction?
Have you considered using a VIEW or a Stored Procedure to copy the data?