Answer the question
In order to leave comments, you need to log in
How to fix some news in the top in mySql when selecting news from the database?
Hello! Is it possible to fix certain news in the top with one query when selecting news from the mySql database so that it is always at the top? How to do it?
Answer the question
In order to leave comments, you need to log in
for example, if it should be an entry with id = 3:
SELECT * FROM news ORDER BY IF(id = 3, 1, 0) DESC, id DESC
Via CSS:
Add to image width:500px
The browser will choose a proportional height.
Through PHP:
$size=GetImageSize("photo.jpg");
$src=ImageCreateFromJPEG("photo.jpg");
$iw=$size[0];
$ih=$size[1];
$koe=$iw/150; //150 - ширина.
$new_h=ceil($ih/$koe);
$dst=ImageCreateTrueColor(150, $new_h);
ImageCopyResampled($dst, $src, 0, 0, 0, 0, 150, $new_h, $iw, $ih);
ImageJPEG($dst, "small_photo.jpg", 100);
imagedestroy($src);
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question