Jump to content

nuttycoder

Members
  • Posts

    233
  • Joined

  • Last visited

    Never

Everything posted by nuttycoder

  1. Thanks very much this looks great! just 1 thing I don't understand a root category has a parent_Id of 0 then sub category's have a parent_id of something higher which makes perfect sense. but what I don't get how is the higher numbers relate to a certain category in my head it looks like any sub-category that has a parent_id of 1 would relate to all category's with a parent_id of 0 which am sure is not the case just not sure how the relations work could you explain this if possible? Thanks for your help
  2. yeah it sort of does, don't supose you could show an example could you? Cheers
  3. Hi I've been looking through google to try and find a tutorial that explains how to make category's and sub category's so far I haven't had any look. Does anyone know of any good tutorials for this? I've managed to make category's with articles relative to each category but it would be much better to be able to make sub category's. Thanks in advance.
  4. I have changed my table structue to use timestamp and have changed my sql query to match <?php $query = "INSERT INTO news (newsTitle, newsCont, newsDate, timestampColumn) VALUES ('$newsTitle', '$newsCont', '$newsDate',NOW())"; ?> but now the request just fails.
  5. Thanks I tried doing the NOW() <input type="hidden" name="newsDate" value="<?= NOW();?>"> but that gives me Fatal error: Call to undefined function:
  6. Hi I am trying to auto date dates into the database with every entry but so far all can get is 0000-00-00 00:00:00 using datetime data type. Here is my code for inserting into the databse if(isset($_POST['Submit'])) { $newsTitle = $_POST['newsTitle']; $newsCont = $_POST['newsCont']; if(!get_magic_quotes_gpc()) { $newsTitle = addslashes($newsTitle); $newsCont = addslashes($newsCont); } $query = " INSERT INTO news (newsTitle, newsCont, newsDate) VALUES ('$newsTitle', '$newsCont', '$newsDate')"; mysql_query($query) or die('Error ,query failed'); echo "'$newsTitle' added"; } ?> <table width="71%" border="0" align="center"> <tr> <td> <form method="post" action="insert-news.php"> <input type="hidden" name="newsID" value="<?=$newsID;?>"> <p>News Title <br /> <input name="newsTitle" type="text" size="40" maxlength="255" > <br /> <br /> News Content<br /> <textarea name="newsCont" cols="80" rows="15" id="newsCont"></textarea> <input type="hidden" name="newsDate" value="<?=$newsDate;?>"> <br /> <input type="submit" name="Submit" value="Add News"> </p> <p align="center"><a href="../stories">Back to Admin</a></p> </form> </td> </tr> </table> Any help on guide me where am going wrong would be great Thanks
  7. have a loot at this tutorial http://www.php-mysql-tutorial.com/cms-php-mysql.php Easy to follow and with a little modification should do what your after
  8. Hi I am building a drinks database/search site. At present I have 26 tables 1 table for each letter like drinksa, drinkb, drinkc..ect which represent a, b, c...ect I have realised this methed it not good practice as I can't search all 26 tables in one go. What I would like to do now is put all the drink a to z in one table called drinks. I would then be able to search that 1 table, this is fine I can do that without a problem. But I am haing some difficulty getting my head around the front end what I mean is on the front end of the site on the drinks page there are links to each section like a, b ,c, d, e,......x, y, z. But if all the data is in one table then all the drinks a to z would be output I know I can limit how many to output but I was wondering is it possible to limit by starting letter For example when a user clicks "A" then all the drink starting with "A" are output but not any other drinks starting with a diffrent letter. This would be done by usin an sql statment I belive by using limit but am not sure if its possble to limit by letter. I have been looking at a lot of foums and so far I have not come across anything that may be of help so I though I'd ask If anyone would point me in the rihgt direction or could expmain if this is possible or a better way of doing this I would be very greatful Thanks Dave
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.