Find Jobs
Hire Freelancers

need 2 PHP/mySQL modifications working together ...

$30-250 USD

Décerné
Publié il y a presque 12 ans

$30-250 USD

Payé lors de la livraison
I have a line of code and 2 different modifications, by 2 different programmers. What I need done is them both working together correctly. I'm sure that someone with a good understanding of PHP can figure this out quite quickly. The first modification sorts an array of categories alphabetically, while the second modification shows only categories which have products listed within. The ORIGINAL code line is: --------------------------------------------------------------------------------------------------------------------------------------- while ($cat_details = $db->fetch_array($sql_select_categories)) { $subcat_link = basename($_SERVER['PHP_SELF']) . '?parent_id=' . $cat_details['category_id'] . $additional_vars; $output .= '<tr> '. ' <td class="contentfont">&nbsp;&raquo; <a href="' . $subcat_link . '">' . $category_lang[$cat_details['category_id']] . '</a></td> '. '</tr> '; } --------------------------------------------------------------------------------------------------------------------------------------- The FIRST MODIFICATION tells me to replace the original code with: --------------------------------------------------------------------------------------------------------------------------------------- while ($cat_details = $db->fetch_array($sql_select_categories)) { $cat_array[$cat_details['category_id']]["name"]=$category_lang[$cat_details['category_id']]; } if(is_array($cat_array)){ asort($cat_array); foreach($cat_array as $key => $value){ $subcat_link = basename($_SERVER['PHP_SELF']) . '?parent_id=' . $key . $additional_vars; $output .= '<tr> '. ' <td class="contentfont">&nbsp;&raquo; <a href="' . $subcat_link . '">' . $category_lang[$key] . '</a></td> '. '</tr> '; } } --------------------------------------------------------------------------------------------------------------------------------------- While the SECOND MODIFICATION tells me to replace the original code with: --------------------------------------------------------------------------------------------------------------------------------------- if ($cat_counter[$cat_details['category_id']] > 0 || COUNT_CATS == 0) { $output .= '<tr> '. ' <td class="contentfont"> » <a href="' . $subcat_link . '">' . $category_lang[$cat_details['category_id']] . '</a> '. (($cat_counter[$cat_details['category_id']]) ? '<span class="cnt">(' . $cat_counter[$cat_details['category_id']] .')</span>' : ''). ' </td> '. '</tr> '; } --------------------------------------------------------------------------------------------------------------------------------------- So again, what I need is BOTH modifications working together as ONE, with both functions working correctly. I am also attaching a TXT file with the code again in case it doesn't display correctly.
N° de projet : 1598669

Concernant le projet

5 propositions
Projet à distance
Actif à il y a 12 ans

Cherchez-vous à gagner de l'argent ?

Avantages de faire une offre sur Freelancer

Fixez votre budget et vos délais
Soyez payé pour votre travail
Surlignez votre proposition
Il est gratuit de s'inscrire et de faire des offres sur des travaux
5 freelances proposent en moyenne $37 USD pour ce travail
Avatar de l'utilisateur
hi sir i can do it for you
$30 USD en 0 jour
4,9 (221 commentaires)
6,4
6,4
Avatar de l'utilisateur
please check your pmb
$30 USD en 1 jour
5,0 (29 commentaires)
5,3
5,3
Avatar de l'utilisateur
hi there, i have a different approach for, check PM
$50 USD en 0 jour
5,0 (2 commentaires)
1,6
1,6
Avatar de l'utilisateur
Hello, I am interested in your project, I want to work with you, if you are interested. Please check you PMB
$35 USD en 2 jours
0,0 (0 commentaires)
0,0
0,0
Avatar de l'utilisateur
Hi I can help with the modification you need, I'm a very good PHP developer.
$40 USD en 1 jour
0,0 (0 commentaires)
0,0
0,0

À propos du client

Drapeau de THAILAND
Bangkok, Thailand
5,0
3
Méthode de paiement vérifiée
Membre depuis sept. 5, 2011

Vérification du client

Merci ! Nous vous avons envoyé un lien par e-mail afin de réclamer votre crédit gratuit.
Une erreur a eu lieu lors de l'envoi de votre e-mail. Veuillez réessayer.
Utilisateurs enregistrés Total des travaux publiés
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Chargement de l'aperçu
Permission donnée pour la géolocalisation.
Votre session de connexion a expiré et vous avez été déconnecté. Veuillez vous connecter à nouveau.