Re: php script to create mySQL database programmatically



mistral wrote:
"Jerry Stuckle писал(а):
"

mistral wrote:

Need php script to create mySQL database programmatically; since
hosting configuration may not allow create database from script, script
also need eliminate/rewrite all restrictions in appropriate places in
that hosting.


You can make a script to create a database. But you can't make a script
which will hack the host's security settings.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================

======================================

Need working code to create database programmatically via PHP.

M.


Not a problem. Here are some links to get you started:

For the SQL you need:

http://dev.mysql.com/doc/refman/5.1/en/create-database.html
http://dev.mysql.com/doc/refman/5.1/en/create-table.html

And optionally:

http://dev.mysql.com/doc/refman/5.1/en/create-index.html


From the PHP end, check out:

http://www.php.net/manual/en/function.mysql-connect.php
http://www.php.net/manual/en/function.mysql-create-db.php
http://www.php.net/manual/en/function.mysql-select-db.php
http://www.php.net/manual/en/function.mysql-query.php
http://www.php.net/manual/en/function.mysql-close.php

And for error processing, you'll want:

http://www.php.net/manual/en/function.mysql-error.php

This should get you started.

--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@xxxxxxxxxxxxx
==================
.



Relevant Pages

  • Re: script dies yet there are no errors in error log
    ... It might be better to ensure the case of the entries in the database, ... This kind of error usually is caused by a CGI or PHP failing to ... input could not be more simple, just a bunch of UPC codes, one per line: ... Given 15 such numbers, the script does fine. ...
    (comp.lang.php)
  • Re: Confused About PHP!?
    ... this example script then just cut and past the iinput elements into ... I am creating a site in FrontPage, and want to use PHP to validate a form I ... to return on a plain HTML page (without any site design features). ... already in the database. ...
    (comp.lang.php)
  • Re: Newbie Security Questions
    ... with $username and $password defined elsewhere in the source file. ... as you'd be a fool to have your database server ... went hunting through my html and found the php script they could ... more rights to a script than it needs. ...
    (comp.lang.php)
  • Re: What Next?
    ... PHP, but it has far fewer built-in functions, which makes it a bit neater ... For example, if you need to use a database, there are built-in database ... I came from Perl to PHP (which is not to say that I don't still use Perl ... form fields against a server script in a javascript "onblur" event. ...
    (comp.lang.php)
  • Re: Error 444 Script or Action Blocked
    ... This is a relatively simple script. ... and compares it to a tab-delimited flat-text database. ... The only real PHP code in the script is as follows: ... It may not solve your problem, but it will fix another potential problem you can have with some browsers. ...
    (comp.lang.php)