Php function to get data from mysql.
$10-30 USD
Pagado a la entrega
Using php get 10 values from a mysql table with a select and if the 10 values are not obtained then the function must get the rest of the values needed for the 10 under another select.
The following function must be modified to get the $array.
private function getTagArray($idChannel){
$array = array();
$sql = "SELECT idTagPhoto FROM ((SELECT idTagPhoto FROM ((SELECT idTagPhoto,votes FROM tagphotos_view WHERE (idChannel = $idChannel) ORDER BY idTagPhoto DESC limit 500) as tagphotos_view3) ORDER BY votes DESC limit 100) as tagphotos_view2) GROUP BY idTagPhoto ORDER BY RAND() LIMIT 10";
$result = mysqli_query($this->db, $sql);
$rows = mysqli_num_rows($result);
while($row = $result->fetch_assoc()){
array_push($array, $row["idTagPhoto"]);
}
return $array;
}
}
The "SELECT" of my code must be respected to get the same result, but the function must be modified so that if the select does not reach 10 data, for example if this select only obtains 7 data, the other 3 data must obtain them in another way:
"SELECT idTagPhoto FROM tagphotos_view WHERE (idChannel = 1) LIMIT 3"
I will try the code on my computer to see if it works.
Nº del proyecto: #12711134
Sobre el proyecto
21 freelancers están ofertando un promedio de $26 por este trabajo
Greetings! I am an expert PHP programmer and I have just seen your project description. I can complete this function modification within an hour max. Looking forward to hear from you.
Hi, I read carefully your project, and I wanna do it for you. If you wanna work together, send me a message to discuss details. I am an experienced Web Developer and Web Designer, and have worked with wide variety of s Más
Hello there i am a professional and have extensive experience, please contact to discuss in details.. i will be waiting thanks regards
Hi, hope you're fine. This is an easy task, should be something very quick. I'm a web developer and database admin. If you agree, I would suggest to use the same query with an "UNION" clause to merge the record fro Más
Hello there. This looks like a simple task and I should be able to deliver it quickly. We can discuss more details over chat if you're interested. Thanks in advance. Best regards, Diogo Bragança
Hey, I had a chance to go through your complete job description. And we think this is the best project matching with our skills. I would like to have a verbal conversation with you to walk through your web developmen Más