Run SQL Script
Menu Run SQL Script
 

Run SQL Script

Page to run a SQL Script.

Has NOINDEX Meta - as I don't want it to be found out of context. Google tracking is also removed as I don't wnat multiple entries in the reports as this page will have to be loaded many times to debug the scripts.

Initially the scripts will be based on the PHP scripts that I have working previously

The PHP SQL will be replaced on the page as required. The output is echoed to the screen using simple PHP ECHO. Eventually I want this to be formatted to a page based on the current format.

- I am not sure this is any quicker than using PHPMyAdmin and running query from there.

Button above will replace "Run Script".

Top

Run Script

Populate from mySQL:

- the current PHP script

The PHP file is: demo_db_select_pdo.php (this will be replace appropriately)

The SELECT script runs - next step is the table create script - what happens when you try to create a table that already exists? The PHP SQL script contains error-checking -- for the SELECT it is the number of rows. A CREATE is not successful may another error. (doing some research it looks like the statement does not return a value)

The SQL statement is the PHP variable $sql in the PHP script.

Documentation

I have improved this considerably since I started the project. However, I don't think that I can highlight SQL. Maybe PHP????? - Looking for this I came across the w3-filter class, which could be useful for filtering search results.

A simple connect and echo table contents.

The SELECT PHP is:

$sql = "SELECT id, firstname, lastname FROM MyGuests";
$result = $conn->query($sql);

if ($result->num_rows > 0) {
   // output data of each row
while($row = $result->fetch_assoc()) {
echo "
id: ". $row["id"]. " - Name: ". $row["firstname"]. " " . $row["lastname"] . "
"; }
} else {
echo "0 results";
}

The population of an HTML table from the result of a query

I may have done this before, but I can bet that there are some examples out there!

This example does this https://tryphp.w3schools.com/showphpfile.php?filename=demo_db_select_pdo

CREATE TABLE

create1.php

INSERT

This is the current script being developed

Links

Scripts tested/being tested

External Links Disabled.

tempusfugit.me.uk is a non-commercial website. No payment or benefit is gained by the placement of links toother websites.

The External link is disabled to on this page, please visit other pages

Unlike most genealogical research websites tempusfugit.me.uk does not attempt to get you to "sign-up" when you click on one of their links.

This Wikipedia link is disabled.

The link on Wikipedia was to:

External Links Disabled.

tempusfugit.me.uk is a non-commercial website. No payment or benefit is gained by the placement of links to other websites.

The External link is disabled to on this page, please visit other pages

Top

External Links - references

Site design by Tempusfugit Web Design -