Jump to content

dreamwest

Members
  • Posts

    1,223
  • Joined

  • Last visited

    Never

Everything posted by dreamwest

  1. I never tested it, but its correct. Ill only output "Works" if theres a row in this query: mysql_query("SELECT * FROM `Reply` WHERE `topic_id`='{$topic_id}' ");
  2. - I wouldnt use fetch_array if your defining the field anyway, use fetch_assoc - $result = mysql_num_rows($sql); is in a while loop and shouldnt be - no closing while loop bracket etc..
  3. Just wanted everyone to know the awesome smarty 3 is now available No more {literal} tags around javascript AND selective {nocache} tags to enable dynamic content even on cached pages I must say its very groovy baby! http://www.smarty.net/download.php http://www.smarty.net/do_download.php?download_file=Smarty-3.0rc3.zip
  4. $sql = mysql_query("SELECT * FROM `Topic` WHERE `category_id`='{$category_id}' ORDER BY `id` DESC LIMIT 10")or die(mysql_error()); //remove or die() after testing $num = mysql_num_rows($sql); if($num ==0){ echo 'No results'; die(); } while ($row = mysql_fetch_assoc($sql)){ $topic_id = $row['id']; $topic_name = $row['topic_name']; $posts = $row['posts']; $mem_id = $row['mem_id']; $get_mem_name = mysql_query("SELECT * FROM `Member` WHERE `id`='{$mem_id}' "); $get_mem_row = mysql_fetch_assoc($get_mem_name); $mem_name = $get_mem_row['username']; $get_reply_mem = mysql_query("SELECT * FROM `Reply` WHERE `topic_id`='{$topic_id}' "); $get_results = mysql_num_rows($get_reply_mem); if ($get_results >= 1){ $test = "works"; }else{ $test = "doesn't work"; } echo $test."<br>"; }//end while
  5. Lightbox is too heavy for simple overlays This one only has 2KB of javascript http://www.wizecho.com/nav=scripts&s=lightbox
  6. Resizes, FTP, and ajax upload http://www.wizecho.com/nav=scripts&s=ajax_image
  7. I havent tried it but VLC player can steam all media types on your site
  8. $_GET or $_REQUEST can both pass info through urls
  9. RewriteRule ^songs/movie/(.*).html songs.php?movie=$1 [L,QSA]
  10. RewriteRule ^input=(.*) video.php?input=media/videos/$1.swf [L,QSA]
  11. function redirect( $url ){ if (! headers_sent( ) ){ header( "Location: ".$url ); exit( 0 ); } echo "<script language=Javascript>document.location.href='".$url."';</script>"; exit( 0 ); } redirect('http://wizecho.com'); //redirect to any url
  12. FFXIII is Awesome!.... The end.
  13. Use MATCH AGAINST instead you dont even need to index the field
  14. No, {nocache} in your tpl files will stops smarty from caching that section of code. Your php files stay the same Smarty is god!, do a test with it, and join us on the light side of the force
  15. Take a look at this: http://www.wizecho.com/nav=tricks&s=speed Then get smarty 3 and set caching to true, then {nocache}{/nocache} tags where dynamic content is....check out gamefaqs website to see smarty 3 in action
  16. use a backtick to define the field it the key next to the 1 on your keyboard mysql_query("UPDATE `Users_recover` SET `key` = '{$key}' WHERE `user_name` = '{$user_name}' ") or die(mysql_error());
  17. Thanks! works beutifully
  18. strrchr($img, '.'); Will return the end of the string after the "."
  19. A simpler query method: $query = "INSERT INTO `Users_recover` SET `user_name`='{$user_name}' , `email`='{$email}' , `key`='{$key} "; mysql_query($query) or die("Erro");
  20. ok i tried this but all it return is "1" $arr[] = array('id' => 0, 'title' => funny); $latest[] = array('id' => 23, 'title' => second); $blend = array_merge($latest,$arr); $blend = shuffle($blend); print_r($blend);
  21. if ((($_FILES["file"]["type"] == "image/gif")|| ($_FILES["file"]["type"] == "image/jpeg")|| ($_FILES["file"]["type"] == "image/pjpeg"))){ echo " Image Type: " . $_FILES["file"]["type"] . "<br />"; }
  22. Why cant i shuffle a merged array? $arr[] = array('id' => 0, 'title' => funny); $latest[] = array('id' => 23, 'title' => second); $blend = array_merge($latest,$arr); print_r(shuffle($blend));
  23. Thanks! I think i undestand it now $srt = 1; $end = 10; while ($srt < $end) { $arr[]= array('q_id' => $srt, 'field2' => barry, 'field3' => german) ; ++$srt; }//end while print_r ($arr);
  24. Im trying to specify keys for associative arrays but ive never done it before other than via mysql This: $srt = 1; $end = 10; while ($srt < $end) { $arr[]= $srt; ++$srt; }//end while print_r ($arr); Outputs: (10 loops) Array ( [0] => 1 [1] => 2 [2] => 3 [3] => 4 [4] => 5 [5] => 6 [6] => 7 [7] => 8 [8] => 9 ) But how can i get it like this: (1 loop example) Array ( [0] => Array ( [q_id] => 1 [q_v_id] => 857434 [q_session] => fe13c9e53d1e6d0170a59f88c6327547 ) )
×
×
  • 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.