LeonLatex Posted June 9, 2022 Share Posted June 9, 2022 When it comes to MySQL objects, classes, variables, libraries, and functions, it is one of these that is pre-set/predetermined/developed, so there is something I misunderstand. This applies to the four different mentioned above, so it is one of the above mentioned that MySQL AB has pre-developed, so it is only to call up, this pre-made/ready to use....thing....😂 if you understand what I mean? If you understand what I mean then my question is: Where can I find a complete list, an overview of "what I am looking for"? I tried the PHP Reference Manual on php.net, but I did not find it there. I googled and searched, but I cannot find such an overview anywhere. Getting an answer to this would help me a lot in moving forward in my study of POD. Maybe this question sounds stupid, but it's the best way I can ask in English. Quote Link to comment https://forums.phpfreaks.com/topic/314910-objects-classes-variables-libraries-and-functions/ Share on other sites More sharing options...
requinix Posted June 10, 2022 Share Posted June 10, 2022 2 hours ago, LeonLatex said: if you understand what I mean? And if I don't? Quote Link to comment https://forums.phpfreaks.com/topic/314910-objects-classes-variables-libraries-and-functions/#findComment-1597175 Share on other sites More sharing options...
mac_gyver Posted June 10, 2022 Share Posted June 10, 2022 MySQL AB was (past tense, currently owned by Oracle) the original developer of the MySQL database server, which implements their own variation of the Structured Query Language (SQL.) i am guessing your post above is asking about the documentation for MySQL? that can be found at https://dev.mysql.com/doc/refman/8.0/en/ . the most relevant sections for the SQL they implement would be in 13.2 Data Manipulation Statements, for SELECT, INSERT, UPDATE, and occasionally DELETE queries. other often used sections in the documentation are sections 9 - 12 language structure, character sets, collations, unicode, data types, and operators and functions. the SQL language that MySQL implements has nothing directly to do with php or the php extension (mysqli or PDO) you use. MySQL is a database server. Php is functioning as a client program, connecting to that server. after making a connection to the database server, you are building and sending SQL query statements to the server, retrieving, and using the result from the queries. the php database extension (mysqli or PDO) is just the means you are using within the php code to interact with the MySQL database server. Quote Link to comment https://forums.phpfreaks.com/topic/314910-objects-classes-variables-libraries-and-functions/#findComment-1597176 Share on other sites More sharing options...
LeonLatex Posted June 10, 2022 Author Share Posted June 10, 2022 3 hours ago, requinix said: And if I don't? Then you can't help me. Quote Link to comment https://forums.phpfreaks.com/topic/314910-objects-classes-variables-libraries-and-functions/#findComment-1597180 Share on other sites More sharing options...
requinix Posted June 10, 2022 Share Posted June 10, 2022 I take it that means you don't plan to try to restate your question? Quote Link to comment https://forums.phpfreaks.com/topic/314910-objects-classes-variables-libraries-and-functions/#findComment-1597181 Share on other sites More sharing options...
LeonLatex Posted June 10, 2022 Author Share Posted June 10, 2022 9 hours ago, LeonLatex said: Then you can't help me. Yes, you can help me. Actually, I looked at my question when I woke up this morning. So I just tried to be sarcastic back to my face. Because I saw how lame and stupid I can be when I'm tired and desperate to manage things. So please give me a couple of hours and I will reformulate my question so it is at least can do it understandable and not make me sound so stupid. So, please, bear over with me one more time, and please forgive me.. I'll be back later this night (Norwegian time) 🙂 So sorry, requinix. I was just sarcastic to myself. I was so fed up 😐 Quote Link to comment https://forums.phpfreaks.com/topic/314910-objects-classes-variables-libraries-and-functions/#findComment-1597185 Share on other sites More sharing options...
LeonLatex Posted June 10, 2022 Author Share Posted June 10, 2022 requinix and mac_gyver What I look for is an overview / an indexed list of .... e.g. in "new PDO refer to in PDO. What does PDO refer to?" O "in PDO stands for" object "(possibly I am wrong now and there is no such thing as pre-developed" object ". Struggling to find out what they are called / do not remember ) Is there a list of the objects (or the word/category i a'am looking for) that have been developed / made by MySQL AB? Did this get any clearer? ...or I think mac_gyver i into it in hes ansver above. Got to read that once more. Quote Link to comment https://forums.phpfreaks.com/topic/314910-objects-classes-variables-libraries-and-functions/#findComment-1597187 Share on other sites More sharing options...
mac_gyver Posted June 10, 2022 Share Posted June 10, 2022 the PDO documentation section in the php.net manual https://www.php.net/manual/en/book.pdo.php is what you are looking for. the PDO acronym stands for PHP Data Objects and is found in the Introduction section. the most relevant, commonly used sections to learn first are - PDO constructor - makes a connection PDO query - executes a non-prepared query PDO prepare - prepare a prepared query PDO lastInsertid - gets the last insert id from an insert/update query PDOStatement execute - executes a prepared query PDOStatement various fetch methods - fetch, fetchAll, fetchColumn - fetches data from a select query PDOStatement rowCount - gets the number of affected rows from an insert/update/delete query PDOException - used when handling user recoverable errors in your application when you make the database connection using PDO, you should - set the character set to match your database tables, so that no character conversion occurs over the connection. set the error mode to use exceptions (i think i saw recently that this is the default now, but set it anyways.) the connection already always uses exceptions. the simplest application code will result if you also use exceptions for all the other statements that can fail - query, prepare, and execute and only attempt to handle exceptions in your code in the case of user recoverable errors, such as inserting/updating duplicate or out of range values. set emulated prepared queries to false, you want to use real prepared queries. set the default fetch mode to assoc, so that you don't have to specify it in each fetch statement. see the following post for typical connection code (end of the post) and converging a non-prepared query to a prepared query - Quote Link to comment https://forums.phpfreaks.com/topic/314910-objects-classes-variables-libraries-and-functions/#findComment-1597191 Share on other sites More sharing options...
mac_gyver Posted June 10, 2022 Share Posted June 10, 2022 also, i think you are getting stuck on the form (words, appearance) and you are not getting to the function (meaning, usage.) you don't actually need to fully understand OOP or the whole PDO extension in order to use it. in your previous thread, i gave list of simple steps on converting existing mysqli based code to use the PDO extension. assuming that you understand what the mysqli code is doing now, this should almost be a no-think exercise. typical prepared query msyqli code, with a multi-row result set - $sql = "some sql query statement containing ? palace-holders for each value"; $stmt = $mysqli->prepare($sql); $stmt->bind_param('s', $some_string_value); $stmt->execute(); $result = $stmt->get_result(); // error now, because get_result depends on the mysqlnd driver // at the point of producing the output foreach($result as $row) { // use elements in $row here... } after converting to use the PDO extension - $sql = "some sql query statement containing ? palace-holders for each value"; $stmt = $pdo->prepare($sql); $stmt->execute([$some_string_value]); $result = $stmt->fetchAll(); // for a multi-row result set, you will typically WANT to fetch all the data at once, so that you can test, couunt, and loop over it as needed // at the point of producing the output foreach($result as $row) { // use elements in $row here... } Quote Link to comment https://forums.phpfreaks.com/topic/314910-objects-classes-variables-libraries-and-functions/#findComment-1597192 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.