dreamwest
-
Posts
1,223 -
Joined
-
Last visited
Never
Posts posted by dreamwest
-
-
- 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..
-
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
-
$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
-
Lightbox is too heavy for simple overlays
This one only has 2KB of javascript
-
-
I havent tried it but VLC player can steam all media types on your site
-
I have no idea why, but evertime i see him on my TV i really want to punch in the face!
And wtf is with him wearing lipstick the puff!
Does anyone else feel this way?
Or do i need help? lol
I had the same feeling towards "Britney spastic"
-
$_GET or $_REQUEST can both pass info through urls
-
RewriteRule ^songs/movie/(.*).html songs.php?movie=$1 [L,QSA]
-
RewriteRule ^input=(.*) video.php?input=media/videos/$1.swf [L,QSA]
-
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
-
FFXIII is Awesome!....
The end.
-
Use MATCH AGAINST instead you dont even need to index the field
-
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
-
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
-
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());
-
Thanks! works beutifully
-
strrchr($img, '.');
Will return the end of the string after the "."
-
A simpler query method:
$query = "INSERT INTO `Users_recover` SET `user_name`='{$user_name}' , `email`='{$email}' , `key`='{$key} "; mysql_query($query) or die("Erro");
-
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);
-
if ((($_FILES["file"]["type"] == "image/gif")|| ($_FILES["file"]["type"] == "image/jpeg")|| ($_FILES["file"]["type"] == "image/pjpeg"))){ echo " Image Type: " . $_FILES["file"]["type"] . "<br />"; }
-
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));
-
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);
-
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 ) )
Help with this code
in PHP Coding Help
Posted
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}' ");