473,387 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Whats the best way to check if a DB exists through PHP?

384 256MB
Just curitous as to what would be the best way to check if a datbase existed through using PHP, would you use a bool to return true or flase or is there another way?
Aug 28 '09 #1
1 1241
Markus
6,050 Expert 4TB
What DBMS are you using? Most will have a procedural function, *_select_db(), that will return true on success or false on failure - just check this result. Usually, if it returns false, the database won't exist, but don't count on this being the case.

Also, see mysql_list_dbs() (if you're using mysql).
Aug 28 '09 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: a-ok | last post by:
Hi, My client has a product database od around 20000 items. And it is updated every few days when he gets a catalog from the supplier. It's supposed to work like this: if there already is a...
3
by: Kevin Steffer | last post by:
Hi group I have a webform which I want to make an ftp connection for a filetransfer from. The thing is when I use the WebRequest class it says "The URI prefix is not recognized" and my URI is...
136
by: Matt Kruse | last post by:
http://www.JavascriptToolbox.com/bestpractices/ I started writing this up as a guide for some people who were looking for general tips on how to do things the 'right way' with Javascript. Their...
16
by: LP | last post by:
Hi, Every morning a .NET application downloads a file with cumulative data which needs to be appended to SQL Server table. This program needs to identify records that have not been previously...
12
by: Elmo Mäntynen | last post by:
Is there something better than using fnctl? It seems a bit intimidating with a quick look.
14
by: John Salerno | last post by:
What is the best way to check if a file already exists in the current directory? I saw os.path.isfile(), but I'm not sure if that does more than what I need. I just want to check if a file of a...
2
by: Nosferatum | last post by:
This script is meant to limit access by sessions, using username and password from mysql db and redirect users after login according to a given value belonging to each user in the db (10,20,30,40)....
29
by: calvert4rent | last post by:
I need to some sort of data type that will hold a listing of ID's and their counts/frequency. As I do some processing I get an ID back which I need to store and keep an accurate count for how many...
26
by: Muzammil | last post by:
whats the beauty of "malloc" over "new" why its helpful for programmer.for its own memory area.??
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.