Jump to content

eddieblunt

Members
  • Posts

    11
  • Joined

  • Last visited

    Never

About eddieblunt

  • Birthday 07/29/1983

Contact Methods

  • MSN
    eddieblunt@hotmail.co.uk

Profile Information

  • Gender
    Male
  • Location
    West Midlands, UK

eddieblunt's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. That doesn't seem to work? My dates are stored in my database as "1200350730" for example, which is 14/01/08 does the WHERE MONTH(published) = $month know this? I've also tried with and without the DATE_FORMAT on the SELECT line
  2. AV1611 I was thinking, just links with each month at the top of the archive page and have the link read something like: http://www.example.com/2008archive.php?month=Jan
  3. Hi, I've got an image gallery where users can login and upload images. When an images is published it updates the "published" column with the current Unix timestamp I want to be able to display the images on an archive page to view the uploads by month Any ideas on how i should do this? Here's my query string: $query = "SELECT id, picture, user, title, published". "FROM uploads". "WHERE published is not null ". "ORDER BY published DESC ". "LIMIT $offset, $rowsPerPage";
  4. Hi, I've got an image gallery where users can login and upload images. When an images is published it updates the "published" column with the current Unix timestamp I want to be able to display the images on an archive page to view the uploads by month Any ideas on how i should do this? Here's my query string: $query = "SELECT id, picture, user, title, published". "FROM uploads". "WHERE published is not null ". "ORDER BY published DESC ". "LIMIT $offset, $rowsPerPage";
  5. Why won't the following code work? I want to ensure that the logged in user can only delete his/her own stories? and not just type in http://example.com/delete.php?story=1 for example or is there a better way of doing this? <?php include_once('include_fns.php'); $handle = db_connect(); $story = $_REQUEST['story']; $writer = $_SESSION['userid']; $query = "DELETE from stories WHERE id = $story AND writer = $writer"; $result = $handle->query($query); header('Location: '.$_SERVER['HTTP_REFERER']); ?>
  6. hi, i've got a database table storing products for a hire company, the database is a copy of their brochure so i'm sorting by page sections so link to section 4 reads /product.php?page=4 here are the section names Access Equipment 4 Breaking, Drilling & Fixing Equipment 8 Cleaning Equipment 10 Concrete / Cement Equipment 11 Masonry & Tile Equipment 12 Heating & Drying Equipment 13 Power & Site Electrical Equipment 14 Painting & Decorating Equipment 15 Roofing Equipment 16 Plumbing Equipment & Pumps 17 Engineering Equipment 18 Gardening / Landscaping Equipment 19 Woodworking Tools & Equipment 20 Welding Equipment 21 Surveyors Equipment 22 Traffic Management Equipment 23 Building & Site Equipment 24 Scaffolding & Access Systems 27 Fall Protection Systems 30 inside each of the sections there are products which need to be listed under their own sub headings e.g. Page 4 -ladders --size 1 --size 2 --size 3 -Platforms --size a --size b --size c i've added a field into the database table for the sub heading but how can i list all items on each page under their own sub heading? hope that made sense? Quite new to php so detailed help will be required! Thanks
  7. Thanks, can you show me how i should integrate that with my current code? i tried this with 2 links database tables [b]links-uk [/b] and [b]links-new[/b], it didn't submit the info to the database tables? ================================================================ [color=red]<body> <?php if(isset($_POST['save'])) {       $name = $_POST['name'];       $url = $_POST['url'];       $description = $_POST['description'];       $linksnew = $_POST['linksnew'];       $linksuk = $_POST['linksuk'];         if(!get_magic_quotes_gpc())     {       $name  = addslashes($name);       $url  = addslashes($url);       $description = addslashes($description);     }     include 'config.php';     include 'opendb.php';     if (!empty($linksnew)){     $query = "INSERT INTO ($links-new) (name, url, description) VALUES ('$name', '$url', '$description')";     mysql_query($query) or die('Error ,query failed'); } if (!empty($linksuk)){     $query = "INSERT INTO ($links-uk) (name, url, description) VALUES ('$name', '$url', '$description')";     mysql_query($query) or die('Error ,query failed'); }     include 'closedb.php';         echo "Link - '$name' was added";     } ?> </p> <form method="post">   <table width="700" border="0" cellpadding="2" cellspacing="1" class="box" align="center">     <tr>       <td align="right" class="unnamed1">Section</td>       <td class="unnamed1"><select>         <option value="linksnew">New</option>         <option value="linksuk">UK</option>                                       </select>       </td>     </tr>     <tr>       <td align="right" class="unnamed1">Site Name </td>       <td class="unnamed1"><input name="name" type="text" class="box" id="name" size="40"></td>     </tr>     <tr>       <td width="100" align="right" class="unnamed1">URL</td>       <td class="unnamed1"><input name="url" type="text" class="box" id="url" value="http://" size="40"></td>     </tr>     <tr>       <td width="100" align="right" valign="top" class="unnamed1">Description</td>       <td class="unnamed1"><textarea name="description" cols="50" rows="10" class="box" id="description"></textarea></td>     </tr>     <tr>       <td width="100" class="unnamed1">&nbsp;</td>       <td class="unnamed1">&nbsp;</td>     </tr>     <tr>       <td colspan="2" align="center" class="unnamed1"><input name="save" type="submit" class="box" id="save" value="Add Link"></td>     </tr>   </table> </form> </body>[/color] ================================================================
  8. Hi, i'm quite new to php and mysql and i am stuck with the following problem: i want to create an admin section for a website which includes a page to add links to any one of the links pages example: if i set up 5 tables as below in a database called links area1links area2links area3links area4links area5links How would i insert new links to any of the links sections above by using a drop down menu to select the correct mysql database table? i use this code to add links to a single page: =========================================== [color=red]<?php if(isset($_POST['save'])) {     $name = $_POST['name'];     $url = $_POST['url'];     $description = $_POST['description'];         if(!get_magic_quotes_gpc())     {         $name   = addslashes($name);         $url   = addslashes($url);         $description = addslashes($description);     }     include 'config.php';     include 'opendb.php';         $query = "INSERT INTO links (name, url, description) VALUES ('$name', '$url', '$description')";     mysql_query($query) or die('Error ,query failed');     include 'closedb.php';         echo "Link - '$name' was added";     } ?>[/color] =========================================== hope that made sense and hope you can help? Thanks, Eddie
×
×
  • 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.