Creating a View

This is a discussion on Creating a View within the MySQL Database forums, part of the Database Forums category; I am having a terrible time trying to create a view. Here is the sql string: $sql = "CREATE VIEW ...


Go Back   Usenet Forums > Database Forums > MySQL Database

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 09-03-2006
Whit
 
Posts: n/a
Default Creating a View

I am having a terrible time trying to create a view. Here is the sql
string:

$sql = "CREATE VIEW v AS SELECT * FROM t1;";

Here is the error:

You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near 'VIEW v
AS SELECT * FROM t1' at line 1

So simple, yet so vexing. Any thoughts? Thanks,

-- whit nelson

Reply With Quote
  #2 (permalink)  
Old 09-03-2006
Bill Karwin
 
Posts: n/a
Default Re: Creating a View

Whit wrote:
> I am having a terrible time trying to create a view.


Try this: "SELECT VERSION();"

If it says you are using a version prior to 5.0, then views are not
supported. Views are a new feature in 5.0.

Regards,
Bill K.
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:26 AM.


Powered by vBulletin® Version 3.6.8
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0