This is my new gift to the MySql Users, Administrators, Developers and any one looking or standard stored procedures and want to reduce development time as well.
My class generates standard stored procedures for every table in your database. So, If you have a MySql DB and needs to generate some standards procedures, I’m sure that you’ll find this script very very useful.
Once you run the script, you’ll notice that you have actually had a 5 stored procedures for each table in your database. Those stored procedures are:
- Get All Fields and Records From Table.
- Get All Fields From Table By Primary Key.
- Insert Into Table.
- Update Table By Primary Key.
- Delete from Table By Primary Key.
To download the class, please click here.
How to use it?
Please open the file in edit mode,� go to the end of file and edit this line with your configurations:
$generateSP = new storedProceduresAutoGenerator(‘Your-DB-Server’, ‘Your-DB-Username’, ‘Your-DB-Password’, ‘Your-DB-Name’, ‘Any-Writable-Path-To-Generate-The-SP-Into’);
Save the file, and then just�run it.
Note: that the Stored Procedures Auto Generator Class has been released with source code under the LGPL free software license.


Thanks Taliba, I was able to translate your replay by google
Keep track of my blog, I’m working on a lot of such scripts that you’ll find more interest.
Spero che tutti i migliori, l’uomo, grazie per questa classe inshallah io uso nel mio lavoro:) .. Dispiace per il primo commento
Non ti preoccupare “Abdelhadi”, I’ll eliminarlo.
any sample how to use this script ?
tnx
Sorry
Pleae check the post again, I have added “How to”.
Thanks.
nice … it works fine
tnx
Warning: file_put_contents(C:/wamp\www\procedure\sql\GetAllUser.sql) [function.file-put-contents]: failed to open stream: No such file or directory in C:\wamp\www\procedure\storedProceduresAutoGenerator.php on line 394
what is wrong ?
$generateSP = new storedProceduresAutoGenerator(‘localhost’, ‘root’, ”, ‘mysql’, ‘C:\wamp\www\procedure’);
Ok, fine.
Please create a folder named “sql”.
Right click on the folder.
Go to “Security Tab”.
Add “Everyone” user to the users list.
Give “read, write and execute” permission to “everyone” user.
Enjoy.
Nice site!
Hi,
the file cudnt be opened using winzip. its in .gz extension and it shows invalid archive directory. Can you point me where I am able to download it ?
Thanks
thank you, bro
Your blog is interesting!
Keep up the good work!
Let me begin by saying that i love your blog anas.al-far.com a lot
now.. back on topic hehe
I cant say that im 100% with what you typed up… care to explain deeper?
Cool blog.
Thanks, webmaster.
Beautiful design.
Thanks, webmaster.
Amazing site.
Thanks, webmaster.
Hi, how I can send PM?
Excellent design, Tnks webmaster.
This is very helpful.
Very nice site!
you might want to consider installing a spam filter on your blog =)
Very nice site!
Thanks you script really helped me chew in a lot of work . cheers .
i got urs auot generate stored procedur. but how can i run php file to generat stored procedure.
Samir: are you using Windows/Linux OS? also, do you have any PHP editor installed? or any development package like AppServ?
in autogenerate stored procedure . where i put storedprocedure.php in separate folder or else?
igot error like Warning: file_put_contents(C:\xampp\htdocs\sql\sql\UpdateZone_masterByID.sql) [function.file-put-contents]: failed to open stream: No such file or directory in C:\xampp\htdocs\bpb\storedproceduresautogenerator.php on line 390
Warning: chmod() [function.chmod]: No such file or directory in C:\xampp\htdocs\bpb\storedproceduresautogenerator.php on line 391
Warning: file_put_contents(C:\xampp\htdocs\sql\sql\InsertIntoZone_master.sql) [function.file-put-contents]: failed to open stream: No such file or directory in C:\xampp\htdocs\bpb\storedproceduresautogenerator.php on line 392
Warning: chmod() [function.chmod]: No such file or directory in C:\xampp\htdocs\bpb\storedproceduresautogenerator.php on line 393
Warning: file_put_contents(C:\xampp\htdocs\sql\sql\GetAllZone_master.sql) [function.file-put-contents]: failed to open stream: No such file or directory in C:\xampp\htdocs\bpb\storedproceduresautogenerator.php on line 394
Samir:
ok, you just need to create this directory on your machine:
C:\xampp\htdocs\sql\sql\
and make sure its writeable!
Thanks Anas al-Far,
Your scripts saved me days worth of work.
Keep up the great work!
Robert
This is my code:
$generateSP = new storedProceduresAutoGenerator(‘localhost’, ‘root’, ”, ‘test’, ‘C:\wamp\www\sql\sql’);
My dir: C:\wamp\www\sql\sql has already created, and is writeable.
And when I exec this, this is my result:
http://i833.photobucket.com/albums/zz251/AzuriVN/05-12-201010-24-40SA.jpg
Plz help me :[.
could you check if there’s set_time_limit in my code ? if not, please use set_time_limit(0) in the beginning of the file.
That error occurred when I used Wamp Server.
When I change to Xamp Server, it works fine.
So I think I have to config something in php.ini to run this code.
Btw, thank for your class, it is very helpful
.
Great, and you are welcome
Thanks for the code – I modified it a bit to fit my specific needs and it will save me a ton of time!
You are most welcome, please let me know if anything should be modified on my code.
Also, I’ll add a class builder that calls those SPs soon -written in PHP- so keep n touch
This is really useful and time saving stuff.
But can you provide some thing like http://www.tools4sql.net
If you provide us something like that then it will be very much usefull.
i’m planning to do so, but i have something even better
I’ll provide some classes written in PHP to call those SP.
in shallah soon.
When I was using MY SQL, I used this and it helped me lot. Gr8 work. Lots of Thanks.
But Now I am using MS SQL Server 2008 so do you have or suggest any for the same?
not really, sorry for that
Check out this site (per Raj Shah):
http://www.Tools4SQL.net
This is really very much helpful to MySQL Users.
Can you please add one most important feature of Generating PK-FK Relation Stored Procedure?
http://www.Tools4SQL.net generates it but it can be used only with MS SQL not My SQL or Oracle.
So if you do so then it would be gr8 help.
Thanks Raj
I don’t guess i’ll do it now soon
it needs a lot of work :S
thanks for you
really it’s very good idea
a lot thanks for you