In this lesson, you’ll learn how to abstract your database functions into an re-usable database class you can use again and again. Learning this one simple skill …
Original source
In this lesson, you’ll learn how to abstract your database functions into an re-usable database class you can use again and again. Learning this one simple skill …
Original source
5 responses to “How to Abstract Your MySQL Database Class”
could you shortly explain me how i format the output and running through the array.
$db->get_results("SELECT * FROM $table"));
How can i format the output and use it ?
John, thank you for sharing your knowledge with us, i really respect it! Your videos help me a lot on my php journey!
Greets from other side of the world 🙂
thanks for good video.
I got problem 45tf line of your code where you have "call_user_func_array( array($stmt, 'bind_param'), $this->ref_values($values));"
it return error as follows:
Warning: call_user_func_array() expects parameter 1 to be a valid callback, first array member is not a valid class name or object in C:xampphtdocsecindex.php on line 45
what I found $values has a value as follows:
Array ( [0] => ss [1] => Title_text [2] => Content_text )
I can not figure out why the [0] element has "ss" value corresponding to format.
in the meantime print_r($data) line returns correct values Array ( [post_title] => Title_text [post_content] => Content_text ). any help is approciated.
Can't download the source. Have to donate for them -_- . Make another download link please so I can still get the source
Could you make a video on how to version control your database? I am using Git to version control all the files and so on, however the database is a whole different story and I'm still figuring it out.