Re: creating table help
| From: | Tyler Longren | Date: | Fri, 19 Apr 2002 18:46:44 +0000 |
| Subject: | Re: creating table help | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-93746@lists.php.net to get a copy of this message | ||
I checked the php manual, and there doesn't seem to be a pg_exec function.
You'll probably be able to use pg_query instead. But that error makes it
sound like pg_exec is a valid function for your version of PHP, maybe it's
not in newer versions.
http://www.php.net/manual/en/function.pg-query.php
Anyway, you get that error because you have too many (or too few) parameters
in your pg_exec() function.
----- Original Message -----
From: "webmaster" <webmaster@harbornet.com>
To: <php-general@lists.php.net>
Sent: Friday, April 19, 2002 5:40 AM
Subject: [PHP] creating table help
> I'm very new to php and PostgreSQL. I keep getting the following error
> when I try to create a table:
>
> Warning: Wrong parameter count for pg_exec() in
> /var/www/html/elkan/createtable.php on line 23
> The table, ghdsl could not be created
>
> Here is the code I'm using:
>
> <?php
>
> // set variables
> $tablename = "ghdsl";
> $dbname = "testingdb";
> $user = "testinguser";
> $password = "xxxxxx";
>
> $connect = "pg_connect($dbname, $user, $password)";
>
> $query = "CREATE table $tablename (id INT UNSIGNED NOT NULL
> AUTO_INCREMENT PRIMARY KEY, ip TEXT, customer TEXT, dslphone TEXT, date
> TEXT, vpivci TEXT)";
>
> if (pg_exec($dbname, $query, $connect))
> {
> print ("The table, $tablename was successfully created");
> } else {
> print ("The table, $tablename could not be created");
> }
>
> ?>
>
> thanks for any help.
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php