Jump to content

The Little Guy

Members
  • Posts

    6,675
  • Joined

  • Last visited

Everything posted by The Little Guy

  1. I need to delete rows from a database if the activation code has not been saved, and is over 3 days old. If the activation code has been saved, then ignore it, and don't delete it.
  2. $result = mysql_query("select count(*) from Table" ORDER BY DESC);
  3. I think this is from one of the PHPFreaks Tutorials, But I always use it. [code] <?php $color1 = "#f6f6ff";  $color2 = "#e7e8ff"; $row_count = 0; while ($row=mysql_fetch_array($result)) {         $row_color = ($row_count % 2) ? $color1 : $color2;         echo "<div class='info' id='left' style='background-color:$row_color;'>";         echo "<p class='style2'><img src='/images/".$row['photo']."' alt='".$row['alternate']."'>".nl2br($row['content'])."</p>";         echo "</div>"; $row_count++; } ?> [/code]
  4. if XAMPP is installed then php should work. is the file in the htdoc folder or is it in a sub folder of the htdoc folder?
  5. you never define what $ID before you update your database. You need to define $ID before you can use the SQL update.
  6. Im not 100% sure on what your trying to achieve, so.. could you explain what your are trying to achieve? What is directory for? What are its possible values? what is currentPics for? What are its possible values? So... If I were to take a stab in the dark, I would do this: [code]<?php //Gets the directory, and current image from url and displays it. echo '<img alt="'.$_GET['currentPic'].'" src="'.$_GET['directory'].'/'.$_GET['currentPic'].'.jpg">'; ?>[/code]
  7. that isn't a query, It is just building the link, and this will help the link work better, and be a valid link.
  8. sorry I forgot the quotes, otherwise it will work.
  9. [code]<?php $hour = date(g) - 2; echo date($hour.":i:s"); ?>[/code]
  10. Do you want to post your code?
  11. By the code you gave... You never show us when the function is being used.... How do you use it? Example like this: echo dateDiff($value1, $value2, $value3);
  12. Look at these lines: move_uploaded_file() [code]<form action="" method="post" enctype="multipart/form-data"> <p>Pictures: <input type="file" name="pictures[]" /> <input type="submit" value="Send" /> </p> </form> <?php foreach ($_FILES["pictures"]["error"] as $key => $error) {   if ($error == UPLOAD_ERR_OK) {       $tmp_name = $_FILES["pictures"]["tmp_name"][$key];       $name = $_FILES["pictures"]["name"][$key];       move_uploaded_file($tmp_name, "data/location1/$name");       move_uploaded_file($tmp_name, "data/location2/$name");   } } ?> [/code]
  13. str_replace(" ","%20", $value) Try something like this (Just an example you may need to change): [code] <?php echo '<a href="./gallery/img.php?file='.str_replace(" ","%20", $currentdir).str_replace(" ","%20", $img).'&thumb=0" class="linkopacity" rel="lightbox['.$currentdir.']" title="View Preview" id="<ul><li>Full sized - <a href='.str_replace(" ","%20", $gallery_address).str_replace(" ","%20", $currentdir).str_replace(" ","%20", $img).' target=_blank>'.$img.'</li><li> <a href='.$_SERVER['PHP_SELF'].'?file='.str_replace(" ","%20", $currentdir).str_replace(" ","%20", $img).' target=_blank>Detailed information</li></ul>"> <img src="./gallery/img.php?file='.str_replace(" ","%20", $currentdir).str_replace(" ","%20", $img).'&thumb=1">'; ?>[/code]
  14. http://us3.php.net/zip There are links and descriptions below all the examples on this page. This may help too http://us3.php.net/manual/en/function.ziparchive-addfile.php
  15. Personally I think the forums are fine, the simpler it is the faster it will go, and the less you need to get used to a new look. One thing that could be thought of is leaving this theme, and add additional themes to the board. but here are some themes for when you change. http://themes.simplemachines.org/index.php?action=search;type=0-
  16. Make a navigation bar on the bottom of the page too, right below the last post kind of like this one: [b]PHP Freaks Forums[/b] > [b]@PHPFreaks[/b] > [b]PHPFreaks.com Questions, Comments, & Suggestions[/b] > [b]Start new topic[/b] I don't like having to scroll up ever time (Maybe it is just me). Make a quick Reply box too, one with 4 buttons: Bold, Italic, Underline, and Code. This way you don't need to click on reply to reply to a topic. There could be a thread to to mark the current thread as "RESOLVED", and the thread can only be marked "RESOLVED" by either the thread starter, or any Mod - Administrator. This reply box could be a little taller too.
  17. Try changing this: [code]$del = "DELETE FROM `news` WHERE id=$delid";[/code] To this: [code]$del = "DELETE * FROM `news` WHERE id=$delid";[/code]
  18. I got it... and here is how I did it if anyone wants to know: zip must be enabled on your server. [code]<?php $zip = zip_open($_FILES['origial_file']['tmp_name']); if ($zip) {   while ($zip_entry = zip_read($zip)) {   echo "<b>Name:</b>              " . zip_entry_name($zip_entry) . "\n<br>";   }   zip_close($zip); } ?>[/code]
  19. Is it possible to scan through a zip file on upload, and retrieve all the files that are contained with in that zip file? I would like to save all contents of the zip file to a database, such as... files, folders, and sub files and sub folders. That way people who download the zip file will be able to tell what is inside the file before they download it.
  20. Basically it is a site search to search all the lyrics within my database... Here is the page http://d-top.org/ the search is on the top right side of the page... You tell me how you think that should be done. Please.
  21. How do I get the score of each one from that query? By saying [b]AS score1[/b], will it automatically make score1 become a variable, and same with score2, 3, and 4?  If so... what value do those receive?
  22. Here is where I started: http://devzone.zend.com/node/view/id/627
  23. [code]$query = "SELECT artist,lyric,title,album, MATCH(artist) AGAINST ('$trimmed' IN BOOLEAN mode) AS score1, MATCH(album) AGAINST ('$trimmed' IN BOOLEAN mode) AS score2, MATCH(title) AGAINST ('$trimmed' IN BOOLEAN mode) AS score3, MATCH(lyric) AGAINST ('$trimmed' IN BOOLEAN mode) AS score4 FROM lyrics WHERE  MATCH(artist, album, title, lyric) AGAINST ('$trimmed' IN BOOLEAN mode) ORDER BY score1 ASC";[/code] I modified your so it works didn't bring up errors... for [b]ORDER BY score1[/b], do I need to make it like it is now or like this: [b]ORDER BY score1, score2, score3, score4 ASC[/b] Now what do you mean use php to calculate $score?  I have never done something like that.
×
×
  • 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.