Advertisement
Online Test Banks
Score higher
See Online Test Banks
eLearning
Learning anything is easy
Browse Online Courses
Mobile Apps
Learning on the go
Explore Mobile Apps
Dummies Store
Shop for books and more
Start Shopping

Access and Adapt a Database with MySQL Queries

Part of the PHP & MySQL For Dummies Cheat Sheet

PHP communicates with MySQL databases by sending SQL queries. Here’s a list of SQL queries, with their syntax, that you can use to access, view, and alter the database:

ALTER TABLE table change
CREATE DATABASE database
CREATE TABLE (col def,…,PRIMARY KEY(col))
DELETE FROM tablename WHERE clause
DROP database|table
INSERT INTO table (col,col,…) VALUES (col,col,…)
LOAD DATA INFILE ″filename″ INTO TABLE table
SELECT col,col,… FROM table WHERE clause
SELECT statement UNION SELECT statement
SHOW DATABASES|TABLES
SHOW COLUMNS FROM table
UPDATE table SET col=value,… WHERE clause
  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus
Advertisement
Advertisement

Inside Dummies.com

Dummies.com Sweepstakes

Win an iPad Mini. Enter to win now!