SitePoint Sponsor |
|
User Tag List
Results 1 to 9 of 9
Thread: Show MySQL version.
-
Jan 15, 2005, 20:07 #1
- Join Date
- Aug 2004
- Location
- FL
- Posts
- 72
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Show MySQL version.
Is there a way to show the version of MySQL your running? like phpversion()?
-
Jan 15, 2005, 20:12 #2
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
run this query:
Code:select version()
-
Jan 15, 2005, 20:19 #3
- Join Date
- Aug 2004
- Location
- FL
- Posts
- 72
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by r937
Code:define ('DB_USER', 'myname'); define ('DB_PASSWORD', 'pass'); define ('DB_HOST', 'localhost'); define ('DB_NAME', 'mydb'); // Make the connnection and then select the database. $dbc = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL: ' . mysql_error() ); mysql_select_db (DB_NAME) OR die ('Could not select the database: ' . mysql_error() ); $query="select version()"; $result=mysql_query($query); mysql_close();
-
Jan 15, 2005, 20:50 #4
- Join Date
- Jul 2004
- Location
- canada
- Posts
- 3,193
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
yes
and one more thing when you do
mysql_query() you should use die() here too. like
mysql_query(die(mysql_error()); to see if query executed successfully or not
just a suggestion
-
Jan 16, 2005, 01:41 #5
- Join Date
- Aug 2004
- Location
- FL
- Posts
- 72
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
hmm..i tried the code above and got nothing. is there any other way to acomplish this?
-
Jan 16, 2005, 05:10 #6
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
do you have phpmyadmin or a similar front end program?
-
Jan 16, 2005, 05:16 #7
- Join Date
- Mar 2002
- Location
- Osnabrück
- Posts
- 1,003
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
You can also use mysql_get_server_info to get the version of your MySQL server.
-
Jan 16, 2005, 10:32 #8
- Join Date
- Aug 2004
- Location
- FL
- Posts
- 72
- Mentioned
- 0 Post(s)
- Tagged
- 0 Thread(s)
Originally Posted by r937
-
Jan 16, 2005, 12:32 #9
- Join Date
- Jul 2002
- Location
- Toronto, Canada
- Posts
- 39,347
- Mentioned
- 63 Post(s)
- Tagged
- 3 Thread(s)
Originally Posted by Toolband
Code:select version()
Bookmarks