Jump to content

josephman1988

New Members
  • Posts

    4
  • Joined

  • Last visited

Everything posted by josephman1988

  1. Yer but I don't want to style them in the function itsel'f, is there a way to somehow get the results and pprint them outside the function? For example, I want to print a list of games for a navigation, then i want to print a list for whatever reason in a differnt style .. defining the style in the function will make the data look exactly the same won't it.
  2. Hi guys, I've been working with PHP for a while, and now moving onto OOP, which is proving to be annoyingly hard! I know it might be 're-inventing the wheel', but I'm trying to understand how it all slots together and works, so please hold back a little ;]. The following function is supposed to get the arguments chucked through and run a query, which works fine, i also count the rows in it. However, I want to print the results of the loop as you would normally but OOP in mind. I can loop it and style it easily within the function, but because I may want this data again and again (in different formats across the site), i want to be able to print it out by calling in the class/function. How would I do this? Any tips? What am I doig wrong and/or misunderstanding? Code is as follows: public $numOfQuery; public function select($table, $rows = "*", $where = null, $order = null) { $query = "SELECT " . $rows . " FROM " . $table . ""; if ($where != null) {$query .= " WHERE " . $where . "";} if ($order != null) {$query .= " ORDER BY " . $order . "";} $getQuery = @mysql_query($query); $this->numOfQuery = mysql_num_rows($getQuery); }
  3. The first function is used by dreamweaver to protect from SQL injection, and the whole 'recordset' variables are produced only in dreamweaver.
  4. I wouldn't do web design courses, the online community can teach you everything you need to know, and a hell of alot more. Tutorials give you practical examples, as well as teach you good practices and teach you to code how you want to code. I've had experience with people trying to teach where they try and pass on there nasty coding habits onto others. It takes time, patience, interest and dedication to learn, and can take a while to start developing efficiently, so I'd say, the online community has more advantages then being taught by someone else for a ridiculous amount of money.
×
×
  • Create New...