Jump to content

_EmilsM

Members
  • Posts

    14
  • Joined

  • Last visited

_EmilsM's Achievements

Newbie

Newbie (1/5)

1

Reputation

  1. I mostly use seperate files with seperate directories for file types, for example, classes or functions, template. Then I can easily tell where what is and can find what I want. Another thing I do is name files according to the content, so I can tell witch file coresponds to what.
  2. Hello. Could you please post the "$stmt" variable content?
  3. mysql_query('SELECT COUNT(`product_id`) AS rows FROM `product`' ) this part is not right. put it as a variable $query = mysql_query('SELECT COUNT(`product_id`) AS rows FROM `product`' )or die(mysql_error()); // i know mysql_ not supported but oh well $total_record = mysql_fetch_assoc($query); and query will give you the exact error that is wrong
  4. no, it wont. And the function is about the same as the changeImage() function (javascript) but a bit different.
  5. do img onLoad="setActive()" and make a function that does the right thing
  6. $reurnArray = Array(); while ($row = mysql_fetch_array($chapter_set)) { $returnArray[] = $row["Chapter"]; } return $returnArray;
  7. well cant you make a check in the database or file like sold = 1 or something, so when they try to do it again it just does nothing?
  8. <a href='http://forums.phpfreaks.com' id='sellinglink' onClick='document.getElementById("sellinglink").disabled=true;'>Link Name</a>
  9. $sql = "SELECT P.productID, P.product_name, P.product_details, I.imgID, I.product_price, I.imgName, I.product_dims, I.product_ref, I.product_desc " . "FROM products AS P,product_images AS I " . "WHERE P.productID = I.productID ORDER BY P.productID ASC";
  10. <?php $recommendations = Array("Avocado Chocolate"); if(!empty($recommendations)) { echo '<ul>'; foreach($recommendations as $flavor) { echo '<li>'.$flavor.'</li>'; } echo '</ul>' } ?> .. and you can add to the recommendations array if you want.. $recommendations[] = 'flavor'; or $recommendations = Array('flavor1', 'flavor2', 'flavor3');
  11. Hello, PHPFreaks community!

  12. Only thing i did was added else if instead of else, but yea, it works perfetly for me.
  13. <?php $hour = date('G'); echo "$hour "; if ($hour >= 0 && $hour <= 11) { echo 'Good morning '; } else if ($hour >=12 && $hour <=17) { echo 'Good afternoon '; } else if($hour >=18 && $hour<= 24) { echo 'Good evening '; } ?> using this, prints good afternoon. EDIT. Maybe because $hour is now 18 to 24 for you. Define $hour for yourself, try 0, 11, 12, 17 and you'll see that it changes.
  14. I'd propably create a link with ?id=$row['id'](or your unique row) and just then in that link delete it.. or just redirect back with a get param to the same file and if isset.. EDIT. or.. you could use js + ajax to send data to an independent file to delete it
×
×
  • 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.