+ 5

Where do I write SQL in a PHP or HTML document?

Hopefully this is an easy to answer question. Where do I write my SQL in PHP or HTML documents? I know SQL, but I cannot figure this out. Is it between an opening and closing tag, or is this even possible? Any help is appreciated.

1st May 2018, 11:38 PM
Jax
Jax - avatar
7 odpowiedzi
+ 3
In w3schools a lot of what you want to know is covered. There is documentation on how to create a database, enter records, obtain records, update records, etc. You do not necessarily need to use phpMyAdmin, you can use other clients to run MySQL and you can even create everything through scripts. https://www.w3schools.com/php/php_mysql_intro.asp
2nd May 2018, 1:00 AM
Mickel
Mickel - avatar
+ 3
Mickel Sànchez, thanks so much! This REALLY helps! I just bought a book that goes into deep PHP, and JavaScript. It also teaches basic SQL, but I didn’t know where to write it. Thanks again! 😊
2nd May 2018, 1:03 AM
Jax
Jax - avatar
+ 3
No problem. Good luck with your book!
2nd May 2018, 1:07 AM
Mickel
Mickel - avatar
+ 3
Thanks! Hopefully it’ll teach me much more advanced JavaScript and PHP than here. I feel both of those languages lacked much of their uses in the SL lessons.
2nd May 2018, 1:08 AM
Jax
Jax - avatar
+ 1
You don't write SQL in html document. You can write them in php file. Depending on what you want to achieve. But for query you can go to phpMyAdmin.
1st May 2018, 11:46 PM
Akib
Akib - avatar
+ 1
Okay, thanks guys!
1st May 2018, 11:48 PM
Jax
Jax - avatar
+ 1
You would write it in php and use one of the database connection drivers to then make a query of the database with the SQL string you wrote. It would pass results back and you would parse them in php as well.
2nd May 2018, 1:50 AM
Adam
Adam - avatar