Good SQL Statement Reference?

For all coding issues - MODers and programmers, HTML and more.

Moderators: Jeff250, fliptw

Post Reply
User avatar
Sergeant Thorne
DBB Material Defender
DBB Material Defender
Posts: 4641
Joined: Sun Nov 25, 2001 3:01 am
Location: Indiana, U.S.A.

Good SQL Statement Reference?

Post by Sergeant Thorne »

I've recently switched from ASP to PHP; particularly, right now, I'm looking into using a Microsoft Access database through PHP. I was a little frustrated at first with the apparent lack of any 'insert' command in any of the ODBC-compatible database function groups built into PHP, but I think I've pick up that it's possible to insert entries through executing an SQL statement (odbc_exec(), dbx_query(), or any other functions that allow for it). My question is, are there any good SQL Statement syntax reference resources online? Thanks a lot!
User avatar
DCrazy
DBB Alumni
DBB Alumni
Posts: 8826
Joined: Wed Mar 15, 2000 3:01 am
Location: Seattle

Post by DCrazy »

Um... why would you use Access through PHP? ODBC is incredibly slow, and Access doesn't support anywhere near all the features of a true RDBMS. Instead, use MySQL, available for free from http://www.mysql.com .

But if you're really hell-bent on using Access, ALWAYS use SQL statements. They're much faster and much more flexible. Here's the syntax for an INSERT command:

<tt>INSERT INTO table_name (first_field_name, second_field_name, ...) VALUES (first_field_value, second_field_value, ...)</tt>

The Access help file has a complete reference for all the SQL keywords that Access supports.
User avatar
Sergeant Thorne
DBB Material Defender
DBB Material Defender
Posts: 4641
Joined: Sun Nov 25, 2001 3:01 am
Location: Indiana, U.S.A.

Post by Sergeant Thorne »

  Thank you very much, DCrazy.  I had always been under the impression that MySQL was a very expensive piece of software (perhaps I was thinking of the Microsoft product). To find that this is free for my uses is great!
  I'm going to be tinkering with SQL queries in ODBC until I get the MySQL Server that I downloaded set up. I have been diving into a lot of new things, having recently replaced my IIS with Apache 2.0, ASP with PHP, and now Access DBs with MySQL (though my experience with Access DBs doesn't run very deep). But, I very much prefer the PHP language to JavaScript/JScript (wish I could use it on client-side Image), and I'm looking forward to using MySQL, which, I hear, and have seen to some degree, is very convienient/powerful.
  Thanks again.
User avatar
SSX-Thunderbird
DBB Admiral
DBB Admiral
Posts: 1275
Joined: Sun Jun 03, 2001 2:01 am
Location: Washington (the state, not the city)

Post by SSX-Thunderbird »

You are confusing MySQL with MS SQL. MySQL is 100% free.
R e v
DBB Admiral
DBB Admiral
Posts: 1121
Joined: Wed Mar 24, 1999 3:01 am

Re: Good SQL Statement Reference?

Post by R e v »

Sergeant Thorne wrote:My question is, are there any good SQL Statement syntax reference resources online? Thanks a lot!
www.google.com

And, as the others have pointed out, MySQL is a much better solution than Access.
Post Reply