php - forms & database insert


#1

Hello.

I would like to ask for some help.

I have form with about 30 edit boxes(inputs). First i need to load data from Oracle database, then check, if the database table is empty or there is any record(probably one). If is empty, then insert data, else update the row.

Please, can you give me links to any suitable example?

Thanks

Zvejk


#2

there are a number of good tutorials on working with databases online (See codewalkers, Zend, O’Really, PHPfreaks, webmonkey, and many others) By connecting to Oracle you will be using the Oracle database functions ( http://www.php.net/manual/en/ref.oracle.php ) rather then the MySQL functions. So instead of connecting - you log on, instead of selecting a database you open a cursor. Same basic things - just named different. The ora-open function looks like it has the basic setup given in the user notes. I would look at some of the examples on the oracle functions pages and see how they corrolate to the mysql functions. Then you can look at all the mysql database tutorials and see how to incorporate the Oracle insetead.

Make sense?


#3

this looks sort of like the answer I was looking for, except I’m mysql. I’ll check codewalkers.


#4

Shrubwater -
codewalkers "Creating Dynamic websites with PHP and MySQL is a REALLY good primer for databases (I always recommend it to beginners in database). It takes you from installation of the software (you can always skip that part) to all the basic/common database functions and shows you how to use them in a real scenerio. If you want some links to general DB informtion (Design and queries) let me know. I have a couple up my sleeve.


#5

liq,

Sure would. I have been reading the codewalker tutorials and have found them very helpful. Anything you can add to that would be great.


#6

DB info links:

Database Design:
http://www.geekgirls.com/menu_databases.htm --> do the database design from scratch lessons. You will never regret it

SQL tutorial:
http://www.sqlcourse.com/ --> basic ANSI SQL (none DB specific). http://sqlcourse2.com/ --> More advanced ANSI SQL
With these you will learn SQL that can be used on any database (MySQL, Oracle, Access). Granted each one has minor variations but these will get you 95% there.


#7

Wow! Great stuff. Looks like I got some reading to do! :)