![]() |
|
|
|
|
1
3rd November 18:28
External User
Posts: 1
|
I donīt know if this is the correct place to ask this questions but I haver some doubts about using mysqli class in php. I am designing a web place using wamp2 (php5, mysql 5.0.x ....). My databases have been done using phpmyadmin so they are "normal" mysql, I mean that I have done nothing with SQLITE. On the other hand, I am accessing to my databases and tables using mysqli class and methods for example:
$conn = new mysqli ( ..........) (this is what I am using) I am using that because I read in the internet that mysqli methods where more efficient but I donīt know if itīs correct to use that methods with my mysql database (it runs perfect). so... is it correct? supposing that itīs correct to use it......is it faster and better to use mysqli methods than using the functions that were used before these new classes appeared? thanks... my email is: iorm@euskalnet.net |
|
|
|
|
2
3rd November 18:29
External User
Posts: 1
|
i believe the main reason for mysqli being 'better' than mysql is the object
oriented approach to the api design. there may be other optimizations under the hood, but i am not aware of any off the top of my head (list: feel free to correct me). as per your overall system design, deciding to go w/ mysqli comes down to a few things - do you want to write all the sql by hand - do you plan on using a different database w/ the same system there are more questions of course but anyway; what im getting at is you might want to take a look at something like propel http://propel.phpdb.org/trac/ there are similar systems out there, but to summarize their features they essentially use a code generation paradigm to write all the database i/o in your system on your behalf; then you can just start using it. it is customizable as well. you will find pros / cons to such a system and a learning curve. but mainly i just want to acquaint you with such systems. anyway if youre not going to use something like that id say shoot for mysqli over mysql. -nathan |
|
|
|
|
4
4th November 09:56
External User
Posts: 1
|
You can use either of the clients to access the DB safely.
[At least in theory. I suppose there could exist some unknown bug that makes a serious difference...] It might or might not be faster, depending on a lot of factors, I suspect... It also might be a lot less stable, since it's a lot less pounded upon by millions of users. The speed difference will probably be completely irrelevant to you in your real-life usage, if you're having to ask here... -- Some people have a "gift" link here. Know what I want? I want you to buy a CD from some indie artist. http://cdbaby.com/from/lynch Yeah, I get a buck. So? |
|