Relative Content

Tag Archive for phpsql

SQL PHP last update database

I made a PHP website that use a SQL database for the information.
Now I want to show the date of the last update of that database.

Extract SQL query or write it inside html

I just started with PHP/HTML and saw on most resources, that the query from the sql-database is written inside the HTML code like in the example below.
But this doesn’t really look right to me, so i wanted to ask if this indeed is the correct way or is there some better practice to maybe extract the code in a function in a separate file which returns a array, call it in html and build the elements with a foreach?

Extract SQL query or write it inside html

I just started with PHP/HTML and saw on most resources, that the query from the sql-database is written inside the HTML code like in the example below.
But this doesn’t really look right to me, so i wanted to ask if this indeed is the correct way or is there some better practice to maybe extract the code in a function in a separate file which returns a array, call it in html and build the elements with a foreach?

Extract SQL query or write it inside html

I just started with PHP/HTML and saw on most resources, that the query from the sql-database is written inside the HTML code like in the example below.
But this doesn’t really look right to me, so i wanted to ask if this indeed is the correct way or is there some better practice to maybe extract the code in a function in a separate file which returns a array, call it in html and build the elements with a foreach?

Is there a way to combine 20 INSERT Sql statements?

I want to find out if there is a way to combine 2 INSERT queries.
e.g
INSERT INTO inventory(username) values($username);
INSERT INTO user(username, email, password) values($username, $email, $password);

iterate over rows in a form

basically i want to write a code that iterates through each row in this form and echoes it, but currently when i hit “save” it only echoes the bottom row there.screenshot