I'm writing a DB abstraction layer for my guestbook to use it on mysql or postgre indifferently. The db has a function named m_create_db. For mysql, it calls the mysql_create_db, but i don't know how to do it with postgre! Can you help me?
just use normal SQL 2 standard statements after connecting, eg "create database test". Read further sql for command line options.
i know a bit mysql and php, but i never used the postmaster and the postgre server. The pg_connect function wants a database as one of the arguments right? So, if i want to create that database, how can i use it before it's created? :/
bump 🙂 anyone knows? please i really need it.
man psql will help you
First log in psql using postgres user and template1 database, then you will be able to create a user and another db
beat me, shoot me, but i don't have linux installed anymore (win98 is better! 😉 so i don't have access to man pages. Can't you simply give me the pgsql code that equals: $link = mysql_connect($host, $user, $pass); mysql_create_db($dbname);
????