En cours

Php function to get data from mysql.

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.

Compétences : MySQL, PHP, Architecture Logicielle

Voir plus : php push mysql data, php mysql data push, software write mq4, software write chip epson, useful software write book, software write web specs, free software write user guide, software write edid, free software write company profile, software write websites idea, software write book images, software write books, software write protection, free software write book, software write book, display mysql data php ajax, excel report mysql data using php, jquery ajax json php mysql data entry example, php mysql data analysis, php export mysql data pdf, php mysql data dictionary, software write protect software, php class display mysql data, display mysql data php, software write technical manual

Concernant l'employeur :
( 93 commentaires ) madrid, Spain

N° du projet : #12711134

Décerné à :

phpfreelancer86

Hello Sir, I've reviewed your requirement and I'm ready to work with you. I will provide quality work as well full support for any query. I'm giving you trust for good quality work. I have almost 7+ years of expe Plus

25 $ USD en 0 jours
(49 Commentaires)
5.0

24 freelance font une offre moyenne de $26 pour ce travail

28 $ USD en 1 jour
(161 Commentaires)
8.4
shihan033010

A proposal has not yet been provided

20 $ USD en 1 jour
(303 Commentaires)
6.7
38 $ USD en 0 jours
(138 Commentaires)
6.5
webarox

Hello Greetings of the day!!! I’ve carefully gone through your job posting. I am having 5+ years of experience in Word press, Shopify, HTML and PHP. I have designed many e-commerce and woo-commerce websites in last Plus

30 $ USD en 1 jour
(46 Commentaires)
5.6
jinkhan888

ILM Techno Solution.Pvt.Ltd.India. [url removed, login to view] [url removed, login to view] About:- Welcome to ILM Techno Solutions Pvt. Ltd. clients ranging from Indian business giants to growing enterprises. As a d Plus

25 $ USD en 1 jour
(54 Commentaires)
5.3
DevvTime

Hello there i am a professional and have extensive experience, please contact to discuss in details.. i will be waiting thanks regards

30 $ USD en 2 jours
(27 Commentaires)
5.0
Nawaz091993

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.

25 $ USD en 0 jours
(32 Commentaires)
5.0
testotorko

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 Plus

15 $ USD en 1 jour
(27 Commentaires)
4.9
25 $ USD en 1 jour
(29 Commentaires)
4.5
avinsoln

Respected Recruiter, Went through the Job Post and I am Confident to do your Task. My name is Avinash Singh and I am a Full Stack Developer with experience of 6 years. About my work on Php / MySQL : A. Php Plus

30 $ USD en 1 jour
(5 Commentaires)
4.3
25 $ USD en 1 jour
(24 Commentaires)
4.4
25 $ USD en 1 jour
(6 Commentaires)
3.8
SamamaJaved

Hello dear, i can do this for you. i have read your requirements. seriously, if you want this work be done, contact me so that i can be able to help you Thanks. and Take care..

30 $ USD en 1 jour
(10 Commentaires)
3.5
infoRidge

Greetings from InfoRidge Technology !! Pls go through our work will help you to take decision . [url removed, login to view] Below is a gist of our work. * [url removed, login to view] --- E-Commerce Plus

30 $ USD en 1 jour
(7 Commentaires)
3.3
doublizer

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

30 $ USD en 1 jour
(10 Commentaires)
3.0
18 $ USD en 1 jour
(12 Commentaires)
2.9
Hassan1859

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 Plus

25 $ USD en 1 jour
(1 Commentaire)
2.4
20 $ USD en 0 jours
(3 Commentaires)
2.0
hbelfouaou

Greeting, I am Hassan and i would love to have the chance to discuss your project. looking forward Hassan B

17 $ USD en 2 jours
(0 Commentaires)
0.0
carlamorillo2

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 Plus

15 $ USD en 1 jour
(0 Commentaires)
0.0