I have a MySQL stored procedure function that I need to have coded. It must be callable from within PHP (you will need to provide a "dummy" PHP call page to demonstrate it works). I can send you the SQL create table statements to generate the datamodel. Here's what it needs to do: Overview ======== Reads from a flat import table that is populated from Excel and then moves that data into the "normalized" database structure. The coding should be pretty straightforward but I am having issues with getting the cursor to work for me (I've done a lot of stored procedures in the past, but primarily in Informix and Oracle - not that familiar with MySQL stored procedures). I can provide you with: a) SQL to generate the data model for this. b) Pseudo code of what the Stored Procedure needs to do. I need you go demonstrate that it works (provide me a URL on your test system or something) via simple hello world PHP wrapper page. Then I will pay you $20 via PayPal immediately. Please PM me for details and only if you can complete this within the next 24 hours and have experience with MySQL. Not looking for someone to "learn" how to do this and take a week to code a single procedure. Thanks for the help!Thanks for the help! You can get an idea of it (this is not a complete procedure, but part of it that I am having trouble with) here: http://forums.digitalpoint.com/showthread.php?t=1676759
Hello, PM sent. I can recommend using (if needed) an additional (temporary) table and trigger instead of simple procedure to fill up normalized DB with 1-2 simple queries (or prepared statement) but if procedure is a must I'll try to help you! Regards, Nick
I would like to avoid using a cursor and looping through records as well, but how do you do this when you need the id of each record in order to link the pointers correctly between the relational tables which have foreign key restraints and auto_increment primary keys? Am I missing something? How can you avoid going record by record and storing the new id and using it to populate the linking table, etc... ?
Hi, In your code last_insert_id was not used (as I mark in my PMs) and is out of the cursor loop too. Please check my pseudo-code I sent or contact me via instant messengers (details PMed). Regards, Nick