473,406 Members | 2,894 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,406 software developers and data experts.

PHP code/libraries for creating MySQL databases

Hi All,

I am working on a registration system, and one of the things I am going to
need to be able to do it setup the database tables for each event that I
have registration for. Normally I would do this by hand, but I am wondering
if there are any code libraries out there that could generate the SQL for
me.

Basically I would have a list of column names and types. I know I could
just foreach() through the list, with a switch to divert control to the
different code segments depending on the column type, and at the end I would
have the SQL generated.

This seems like the sort of thing that somebody might have done before and
released a code snippet for. Maybe in PEAR DB? Any ideas?

Sincerely,
-Josh
Jul 17 '05 #1
11 2146
Why on earth don't you use phpMyAdmin? Everybody else does. Visit
http://www.phpmyadmin.net and download the source.

--
Tony Marston

http://www.tonymarston.net


"Joshua Beall" <jb****@donotspam.remove.me.heraldic.us> wrote in message
news:p2bId.10812$ef6.10589@trnddc07...
Hi All,

I am working on a registration system, and one of the things I am going to
need to be able to do it setup the database tables for each event that I
have registration for. Normally I would do this by hand, but I am
wondering if there are any code libraries out there that could generate
the SQL for me.

Basically I would have a list of column names and types. I know I could
just foreach() through the list, with a switch to divert control to the
different code segments depending on the column type, and at the end I
would have the SQL generated.

This seems like the sort of thing that somebody might have done before and
released a code snippet for. Maybe in PEAR DB? Any ideas?

Sincerely,
-Josh

Jul 17 '05 #2
"Tony Marston" <to**@NOSPAM.demon.co.uk> wrote in message
news:cs*******************@news.demon.co.uk...
Why on earth don't you use phpMyAdmin? Everybody else does. Visit
http://www.phpmyadmin.net and download the source.


I must not have asked my question clearly enough - I do not need an end user
application. I was looking for a code library

Scraping the bits I want out of phpMyAdmin is of course an option. But I
was wondering if there was an existing libraries out there that I could just
drop in to place (or include() in place, as the case may be).
Jul 17 '05 #3
I noticed that Message-ID: <p2bId.10812$ef6.10589@trnddc07> from Joshua
Beall contained the following:
I am working on a registration system, and one of the things I am going to
need to be able to do it setup the database tables for each event that I
have registration for. Normally I would do this by hand, but I am wondering
if there are any code libraries out there that could generate the SQL for
me.


A table for each event? Are you sure you mean that?
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #4
"Geoff Berrow" <bl@ckdog.co.uk> wrote in message
news:qo********************************@4ax.com...
I noticed that Message-ID: <p2bId.10812$ef6.10589@trnddc07> from Joshua
Beall contained the following:
I am working on a registration system, and one of the things I am going to
need to be able to do it setup the database tables for each event that I
have registration for. Normally I would do this by hand, but I am
wondering
if there are any code libraries out there that could generate the SQL for
me.


A table for each event? Are you sure you mean that?


Do you have another suggestion? I couldn't think of any other way to do it,
since the information collected for each event will be different (possibly
*very* different).

I'm open to new ideas, though.
Jul 17 '05 #5
I noticed that Message-ID: <MJbId.3567$BL3.3361@trnddc01> from Joshua
Beall contained the following:
A table for each event? Are you sure you mean that?


Do you have another suggestion? I couldn't think of any other way to do it,
since the information collected for each event will be different (possibly
*very* different).


Ah I see what you mean. So an event is like a conference and you want
to store delegate details. Some events may just want name and address
some may want name address, flight details, nationality and so on?

I still don't see why you can't use phpMyadmin to create the tables...
--
Geoff Berrow (put thecat out to email)
It's only Usenet, no one dies.
My opinions, not the committee's, mine.
Simple RFDs http://www.ckdog.co.uk/rfdmaker/
Jul 17 '05 #6
ncf
Why not use one table to hold all the events, and another to hold the
details or whatever you need to hold and the ID of the event. Then you
can access it with a query such as

SELECT * FROM events AS e JOIN details AS d ON (e.id=d.event_id)
Best of Luck.

-Wes

Jul 17 '05 #7
"Geoff Berrow" <bl@ckdog.co.uk> wrote in message
news:oh********************************@4ax.com...
Do you have another suggestion? I couldn't think of any other way to do
it,
since the information collected for each event will be different (possibly
*very* different).
Ah I see what you mean. So an event is like a conference and you want
to store delegate details. Some events may just want name and address
some may want name address, flight details, nationality and so on?


Right, exactly.
I still don't see why you can't use phpMyadmin to create the tables...


Well, I *could*, I'm just wondering if there is a way I could automate the
process. See, my end goal is to just be able to write up an XML file that
describes the conference (name, fields, what fields are required, etc), and
then be able to run a script that will generate the form to collect the
information and the table where that info will be stored.

But I think where I'm landing for now is to just do make the table by hand.
Some time down the road I may try and make it more automated.
Jul 17 '05 #8
"ncf" <no***************@gmail.com> wrote in message
news:11**********************@c13g2000cwb.googlegr oups.com...
Why not use one table to hold all the events, and another to hold the
details or whatever you need to hold and the ID of the event. Then you
can access it with a query such as

SELECT * FROM events AS e JOIN details AS d ON (e.id=d.event_id)


The thing is that this would produce multiple rows for one entry in the
events table. I'd rather not do that. :-/
Jul 17 '05 #9
Joshua Beall wrote:
"Geoff Berrow" <bl@ckdog.co.uk> wrote in message
news:oh********************************@4ax.com...
Do you have another suggestion? I couldn't think of any other way to do
it,
since the information collected for each event will be different (possibly
*very* different).


Ah I see what you mean. So an event is like a conference and you want
to store delegate details. Some events may just want name and address
some may want name address, flight details, nationality and so on?

Right, exactly.

I still don't see why you can't use phpMyadmin to create the tables...

Well, I *could*, I'm just wondering if there is a way I could automate the
process. See, my end goal is to just be able to write up an XML file that
describes the conference (name, fields, what fields are required, etc), and
then be able to run a script that will generate the form to collect the
information and the table where that info will be stored.

But I think where I'm landing for now is to just do make the table by hand.
Some time down the road I may try and make it more automated.

I have found that cut and paste is my friend. For me it is
faster and easier to create model procedures and then modify
them to suit individual applications/tables. Use your favorite
editor to build three php programs, one to create a table with a
primary key and one to generate a form to collect the data to be
used in populating the table and one to process and store the
data.

To handle a new event copy the three progams, edit, execute,
test and verify the results. You should be able to add a new
event in less than ten minutes.

HTH
Jerry
Jul 17 '05 #10
It now appears that the problem your were asking this newsgroup to solve was
totally unrelated to the subject line.

"PHP code/libraries for creating MySQL databases" is about CREATING
databases, not maintaining the contents of databases.

If you do not ask the right question then how are we supposed to supply the
right answer?

If you want to look at the method I have created for automating this process
then take a look at the following articles:

http://www.tonymarston.co.uk/php-mys...seobjects.html
http://www.tonymarston.co.uk/php-mys...eobjects2.html
http://www.tonymarston.co.uk/php-mys...structure.html
http://www.tonymarston.co.uk/php-mys...plication.html

The last article contains a link where you can run my sample application
online, with another to download the source code to see how it's done.

Hope this helps.

--
Tony Marston

http://www.tonymarston.net

"Jerry Gitomer" <jg******@verizon.net> wrote in message
news:sTkId.7849$hC2.6999@trndny04...
Joshua Beall wrote:
"Geoff Berrow" <bl@ckdog.co.uk> wrote in message
news:oh********************************@4ax.com...
Do you have another suggestion? I couldn't think of any other way to do
it,
since the information collected for each event will be different
(possibly
*very* different).

Ah I see what you mean. So an event is like a conference and you want
to store delegate details. Some events may just want name and address
some may want name address, flight details, nationality and so on?

Right, exactly.

I still don't see why you can't use phpMyadmin to create the tables...

Well, I *could*, I'm just wondering if there is a way I could automate
the process. See, my end goal is to just be able to write up an XML file
that describes the conference (name, fields, what fields are required,
etc), and then be able to run a script that will generate the form to
collect the information and the table where that info will be stored.

But I think where I'm landing for now is to just do make the table by
hand. Some time down the road I may try and make it more automated.

I have found that cut and paste is my friend. For me it is faster and
easier to create model procedures and then modify them to suit individual
applications/tables. Use your favorite editor to build three php
programs, one to create a table with a primary key and one to generate a
form to collect the data to be used in populating the table and one to
process and store the data.

To handle a new event copy the three progams, edit, execute, test and
verify the results. You should be able to add a new event in less than
ten minutes.

HTH
Jerry

Jul 17 '05 #11
In article <8AbId.3566$BL3.127@trnddc01>,
"Joshua Beall" <jb****@donotspam.remove.me.heraldic.us> wrote:
"Tony Marston" <to**@NOSPAM.demon.co.uk> wrote in message
news:cs*******************@news.demon.co.uk...
Why on earth don't you use phpMyAdmin? Everybody else does. Visit
http://www.phpmyadmin.net and download the source.


I must not have asked my question clearly enough - I do not need an end user
application. I was looking for a code library

Scraping the bits I want out of phpMyAdmin is of course an option. But I
was wondering if there was an existing libraries out there that I could just
drop in to place (or include() in place, as the case may be).


Yeah, after reading this thread, I'm still confused about what you're
trying to do and what your requirements are. A class with functions to
manipulate MySQL databases? Something to populate an existing database?

For a class, there are a number of things out there. There's PEAR's DB.
I use an SQL class I got from http://www.phpclasses.org

Try explaining more fully what your trying to accomplish rather than a
solution.

--
DeeDee, don't press that button! DeeDee! NO! Dee...

Jul 17 '05 #12

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
by: bigoxygen | last post by:
Hi. I'm using a 3 tier FrontController Design for my web application right now. The problem is that I'm finding to have to duplicate a lot of code for similar functions; for example, listing...
2
by: Gary L. Burnore | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.mysql This is an invitation to discuss the following proposal to create newsgroup comp.databases.mysql. Please note that YOU CANNOT...
8
by: William Drew | last post by:
REQUEST FOR DISCUSSION (RFD) unmoderated group comp.databases.mysql This is an invitation to discuss the following proposal to create newsgroup comp.databases.mysql. Please note that YOU...
0
by: Ola Ogunneye | last post by:
--=_104E0413.12733F99 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit I am running mysql 4.0.13 and using a weblog(Geeklog) to do my web. Using geeklog as been okay...
0
by: Ola Ogunneye | last post by:
--=_075912CF.F899D547 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Hello again all, I have created an account in the particular database that I was trying to...
15
by: Cheryl Langdon | last post by:
Hello everyone, This is my first attempt at getting help in this manner. Please forgive me if this is an inappropriate request. I suddenly find myself in urgent need of instruction on how to...
13
by: Steven Bethard | last post by:
Jean-Paul Calderone <exarkun@divmod.comwrote: Interesting. Could you give a few illustrations of this? (I didn't run into the same problem at all, so I'm curious.) Steve
3
abdoelmasry
by: abdoelmasry | last post by:
Hi All i have webserver , i want to use mysql databases in websites but when i installed mysql server i found that any one have the password for the root can access to all databases on the...
0
Coldfire
by: Coldfire | last post by:
Since i cannot show the differences in a two-column like table. I am first putting MS SQL Server 2005 and then MySQL 5.x. MS SQL Server 2005 Brief Overview - SQL Server is a full-fledged...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.