
johnnyd1963
Members-
Posts
14 -
Joined
-
Last visited
johnnyd1963's Achievements

Newbie (1/5)
0
Reputation
-
thanks for the help
-
can this in an array from 1 to 40 and 01 to 040 thanks
-
or use $rss = $row['dato']; $dayNamesb = array("søndag", "mandag", "tirsdag", "onsdag", "torsdag", "fredag", "lørdag"); $monthNamesb = array("januar", "februar", "mars", "april", "mai", "juni", "juli", "august", "september", "oktober", "november", "desember"); $dato = $dayNamesb[date('w', strtotime($rss))] . ", " . date('d', strtotime($rss)) . " " . $monthNamesb[(date('m', strtotime($rss))-1)] . " " . date('Y', strtotime($rss)); echo $dato; this wil give you something like søndag 29 oktober 2012
-
Hi i have the following proplem I put in a table the following nummber 01 with a form if i want put in nummber 1 without zerro before i have the massege when i check the post is equal to the nummber in the table that these are the same the column in the table is VARCHAR how can i tell in php that 01 not is the same as 1 and visa versa or 02 not the same as 2 thanks in advice John
-
Tanks for your advice i got $query3 ="SELECT * FROM narr_turnier_".$onlyconsonants." UNION ALL SELECT * FROM narr_turnier_".$onlyconsonants."_ster WHERE id_turnier_jaar=".$idjaarturnier." order by rang";
-
My question is How to select form 2 tables where column1 = x order by column2 desc in PHP MYSQL thanks in advice John
-
Update Database - Error - Please Help!
johnnyd1963 replied to lukedouglas98's topic in PHP Coding Help
sorry i see it at ".$id."; it must be ".$id.""; -
Update Database - Error - Please Help!
johnnyd1963 replied to lukedouglas98's topic in PHP Coding Help
try to use $sql="UPDATE micro_blog_posts SET input_text =".$post." WHERE id=".$id."; instaed of $sql="UPDATE `micro_blog_posts` SET `input_text`='$post' WHERE `id`='$id' -
Give Same Rank Where Points Are The Same
johnnyd1963 replied to johnnyd1963's topic in PHP Coding Help
I got the solution :happy-04: Here it is $sql=mysql_query("SELECT * FROM narr_turnier_".$onlyconsonants." WHERE turnier_jaar =".$jaarnu." GROUP BY punkten desc") ; $total_rows=mysql_fetch_assoc($sql); $num_rows = mysql_num_rows($sql); if($total_rows>1) { $i=0; while ($i < $num_rows) {$id=mysql_result($sql,$i,"punkten"); $query1="UPDATE narr_turnier_".$onlyconsonants." SET rang ='".($i + 1)."' WHERE punkten =".$id." && turnier_jaar =".$jaarnu." "; mysql_query($query1) or die (mysql_error()); $i++; } } if you know it it's simpel just think logical thanks for the help to all -
Give Same Rank Where Points Are The Same
johnnyd1963 replied to johnnyd1963's topic in PHP Coding Help
i come back tomorrow i got it allmost. $i=1; $j=0; $con=mysql_connect("localhost","ngkdbuser","Kohlscheid11"); if(!$con) { die("Couldn't connect to the database"); } mysql_select_db("narrengilde",$con); $sql=mysql_query("SELECT * FROM narr_turnier_".$onlyconsonants." WHERE turnier_jaar =".$jaarnu." ORDER BY punkten desc") ; while($row=mysql_fetch_assoc($sql)) { $id=$row['id']; $total=$row['punkten']; $sqlx="SELECT * FROM narr_turnier_".$onlyconsonants." where punkten='$total'"; $rowcount=mysql_num_rows(mysql_query($sqlx)); if($rowcount==1) { $sql22=mysql_query("update narr_turnier_".$onlyconsonants." set rang='$i' where id='$id' AND turnier_jaar = " . $jaarnu.""); mysql_query($sql22,$con); $i=$i+1; } if($rowcount>1) { $j=$j+1; if($j==$rowcount) { $sql22=mysql_query("update narr_turnier_".$onlyconsonants." set rang='".($i)."' where id='$id' AND turnier_jaar = " . $jaarnu.""); mysql_query($sql22,$con); $i=$i+$rowcount; $j=0; } else { $sql22=mysql_query("update narr_turnier_".$onlyconsonants." set rang='".($i)."' where id='$id' AND turnier_jaar = " . $jaarnu.""); mysql_query($sql22,$con); } } } -
Give Same Rank Where Points Are The Same
johnnyd1963 replied to johnnyd1963's topic in PHP Coding Help
oke it's not workin because the ranks wil give 321 321 and so on if you want to see lokk at http://www.narrengilde-kohlscheid.de/php/login/testwolf/punktenliste_tanzturnier_zufugen.php first choose Starter Bambini Garde zufugen then click gewahlt -
try to make $src = imagecreatefromjpeg('tiffany_alvord_heart_2bg9s7p.sized.jpg'); into $src = imagecreatefromjpeg('tiffany_alvord_heart_2bg9s7p.sized.JPG'); look at the difference jpg or JPG
-
You need something like this ? if ($_FILES['foto_mijzelf']['type'] == "image/pjpeg" || $_FILES['foto_mijzelf']['type'] == "image/jpeg" || $_FILES['foto_mijzelf']['type'] == "image/jpg") { $uploaded_foto_mijzelf = $_FILES['foto_mijzelf']['tmp_name']; $imagesize = $_FILES['foto_mijzelf']['size']; $imagetype_persoon = $_FILES['foto_mijzelf']['type']; $image_file_mijzelf=$_FILES['foto_mijzelf']['name']; // haal foto maten list($width, $height) = getimagesize($_FILES['foto_mijzelf']['name']); $imgwidth= $width; $imgheight=$height; $a = ($imgwidth/100); $imageheightpercent= (100/$a); $onePerrcentImgheight=$imgheight/100; $newImgHeight=$onePerrcentImgheight*$imageheightpercent; $imgwidth= $width; $imgheight=$height; $b = ($imgwidth/100); $imagewidthpercent= (100/$B); $onePerrcentImgwidth=$imgwidth/100; $newImgWidth=$onePerrcentImgwidth*$imagewidthpercent; $slides="images"; $thumbs="thumbs"; $new_height1=$newImgWidth; $new_width1=66; $new_height=$newImgHeight; $new_width=100; chdir ($structurec); chdir ($location_thumb_persoon); //if width smaller then height if ($width<=$height){ $src = imagecreatefromjpeg($uploaded_foto_mijzelf); $tmp1=imagecreatetruecolor($new_width1,$new_height1); imagecopyresampled($tmp1,$src,0,0,0,0,$new_width1,$new_height1, $width,$height); imagejpeg($tmp1,$image_file_mijzelf,100); imagedestroy($src); imagedestroy($tmp1); } //if width bigger then hight if ($width>=$height){ $src = imagecreatefromjpeg($uploaded_foto_mijzelf); $tmp1=imagecreatetruecolor($new_width,$new_height); imagecopyresampled($tmp1,$src,0,0,0,0,$new_width,$new_height, $width,$height); imagejpeg($tmp1,$image_file_mijzelf,100); imagedestroy($src); imagedestroy($tmp1); } }
-
Hi it's my first time here. I hope some one wil help me with the following I have a point with rank system its olmost finished i have only one problem. How can i give the same rank where points are the same. i have now the following code $jaarnu = date('Y', strtotime('now')); $query = "SELECT * FROM narr_turnier_".$onlyconsonants." WHERE turnier_jaar =".$jaarnu." ORDER BY punkten desc"; $result=mysql_query($query); $num=mysql_num_rows($result); $i=0; while ($i < $num) { $id=mysql_result($result,$i,"id"); $query1="UPDATE narr_turnier_".$onlyconsonants." SET rang='".($i + 1 )."' WHERE id =".$id." && turnier_jaar =".$jaarnu." "; mysql_query($query1) or die (mysql_error()); $i++; } a little axplanation: rang = Rank and punkten = points I want it as follow: points rank 150 1 150 1 149 2 147 3 146 4 and when the input is again 149 the rank must be again 2 At the moment i have the ranks 1 2 3 4 5 and so on and that's not the right thing. thanks in advice john