Jump to content

akurtula

Member
  • Posts

    87
  • Joined

  • Last visited

Everything posted by akurtula

  1. <?php $con = new Connection_class(); ?> <?php echo $con->dis_books(title); ?> <?php echo $con->dis_books(author); ?>
  2. thanks for the better explenatio, that's exactly what i need to got - the full array. the code you give looks good though i am getting this error fatal error: cannot use[] for reading in c:\xampp.... how can this be solved? thanks for the help
  3. i have not been able to figure this out since i have started looking at oo programing: function dis_books($key){ while ($row = mysql_fetch_array($this->result,MYSQL_ASSOC)) { return $row[$key]; } } } in the database, i have 5 items; with the above code, i only get the first record: also if i echo rather than return the above, it works ( by showing all records) but then i cant reuse it again e.g <?php $con->dis_books(images); ?> <?php $con->dis_books(books); ?> is there something that i am missing ? thanks for the help
  4. every blog has there own feed link build in - when you subscribe you get the latest posts to date. however if you really like the backdated posts, is there a way to modify the feed link to get posts from a specific date (e.g get posts from 2008 to present ) so that then can sit in you rss application giving you the ability to tag then and read them when you get the time this is something that i have not been able to fine through google, so im not sure if what im asking is possible thanks
  5. akurtula

    php frameworks

    hi after few months of practicing with php, i have started to consider having a go at a php framework (thinking of trying cakephp) due to the small amount of experience i have with php - i was wondering if learning a framework is a good idea. as (sorry if im totally wrong) i am thinking that maybe by learning a frame work there may be a chance of slightly forgetting how to use the normal pure php code or if you suggest that i should start looking at frameworks - is there a need to keep a learning balance between learning the framework and learning the normal php thanks
  6. akurtula

    need help

    if you check Stefans work on http://www.killerphp.com/mysql/videos/ that should give you everything you need to set the databases , also the killerphp.com site in general is e very useful resource after checking those videos out then i'm sure we can help you further
  7. hi this topic seems to have been answered, though i have started to you a program called SQLyog, which seem to make it very easy to handle databases, and the transferring seems to be very easy to carryout with this program - especially if you are new at these matters
  8. the example you given in done by using 2 tables, in a database. table one stores the info of the heading and an ID e.g rug 1 rug 2 ... the 2nd table stores the rug ID from table one and the different rugs within that heading: then with sql and php you can the the same effect as your given example, i know the explanation is not really useful but i have done this before and is very easy
  9. <?php echo $conection->viewResult();?>
  10. thanks for the great reply, first of all, the english is pretty good. i agree that i need to ready a lot more on opp. basically the way i thought of Q3 (adding to what you mentioned) , is that if 2 classes cant work without one another, then they should be left in one file, though if one class works out the total of a shopping card and the other connects the database, then they should be in separate files as they can be reused separately - By the way, is there any good book that i should read on OOP Modules - control - view and so on .. ? again thanks
  11. ye i totally agree with you russellharrower . in fact that is the method (simular to wordpress) that i used. though i wanted to see if there is a way of doing it just in one cell - for example if we have a key word of "killerphp" put the user types "kilerPhP" they would not get the result as they are missing an L,
  12. hi after trying out the tutorials on oop by stefan, i then started to convert one of my shopping cart demos using oop php luckly, i think that i got the hang of it, : this is one of my classes: (if there's anything wrong plz let me know) class DbCon { function DbCon($db_host="localhost", $db_user="root", $db_pass="", $db="university") { mysql_connect($db_host, $db_user, $db_pass) or die( "Unable to connect to SQL server"); mysql_select_db($db) or die( "Unable to select database"); $query = "SELECT * FROM kurtula_shop "; $this->result = mysql_query($query); } function viewResult(){ while ($row = mysql_fetch_array($this->result,MYSQL_ASSOC)) { echo " $row[item] $row[description] $row[price] / $row[quantaty] "; } } }//end conect class the above class, does work fine and defenately can see the advantages of using oop. however, referring back to the video tutorials, Stefan clearly mentioned that in the class we should not use echo , or set html tags (which does make sense) though would i be right in thinking that this is one of those situations that (as far as basic) there is no other way of achieving the above, other than echoing the html in the class. Q2: is there a rule of thump into how long a class should be (how many functions should it contain) Q3: should each class be in a separate file or can they all be in one file? (whats the difference) thanks a lot
  13. hi i am a student, so have not had any clients (therefore i do not know how this is aproached on a real for situation) however this is what i do: when i created a shopping card: i went on 2 different online shopping sites and took notes on what were the MAIN elements, for example + a table that showed the items +title, description, price and a buy link + a cart page + again the cart page has a table with the items the user selected + on the table there is a link to remove an item OR modify. + AND MORE (i'm sure you get the idea) then there you have the checklist however, if you are very artistic, then you can go crazy with the design (in which case, you do not need a check list at all) So overall, i always brain storm the things that a site SHOULD have, as e.g if you do not include the above criteria in your site then there is no way you can call it a shopping card right? as for already made check list - i have came across few (which cant remember where) but i found that they did not help me as much as my personal check lists hope you can get something useful out of this
  14. just to hide the sub menu you need: li ul { position: absolute; display: none; } however you'll now need to go back to those tutorials, and the the overall style right (if you haven't already) then to show it back again you need li:hover ul { display: block; } if had no time to check if im right, but i'm sure this is the way to get the very basic hide and show, then you need to style the whole navigation to show as horizontal or vertical hope this is what you were looking for
  15. hi i have created a simple shopping cart (just as a uni project). on the database i stored the items, description, a photograph (the path) and keyword. now i have created a search box as follows: $search = $_POST[searchbox]; SELECT * from shop where keyword = '$search'; ...... now the question is, if i'm selling an mp3 player, there could be a lot of key words, how would i do that, i thought having a row for each keyword, but if an item has over 20 key words, it would seem a waits of space and time to have 20+ rows in the database, so is there a way of having one row (named keyword), and in that sell have keyword1, keyword2, .... then the use would have to type one of the keywords hope im clear thanks very much
×
×
  • Create New...