Passage de php 5.3 vers php 5.6 problèmes

Résolu/Fermé
Tzmagnum - 2 mars 2021 à 23:56
Tzmagnum Messages postés 126 Date d'inscription dimanche 9 août 2009 Statut Membre Dernière intervention 10 mai 2022 - 3 mars 2021 à 14:02
Bonjour,

Voilà je vous explique mon site avant était sur un serveur avec php 5.3 (tout fonctionnait)
On est passé à un serveur php 5.6.

Je ne veux pas augmenter de version php, car pour l'instant j'y connais rien à mysqli & pdo.

Toutes les requêtes mysql de mon site fonctionne, même celle dans le même dossier que la page ci-dessous.

Dans toutes les pages de ce dossier je reprends ceci :

header('Content-type: text/html; charset=utf-8');
include('includes/fonctions.php');
connexionbdd();

global $current_user;
      get_currentuserinfo();


Sur cette page la tout ce qui est html & php apparait bien, sauf que mes requêtes mysql ne s'affiche pas.
La base de donnée mysql & la table existe, sur toutes les autres pages ils n'y a aucun soucis.

Avez-vous une idée pour m'aider svp ?

Merci d'avance

Voici le code entier de la page :

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<meta charset="UTF-8">
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
header('Content-type: text/html; charset=utf-8');
include('includes/fonctions.php');
connexionbdd();

global $current_user;
      get_currentuserinfo();

$pick_date = date("Y-m-d");
$pick_heure = date("H:i:s");
$pick_date_view = date("d/m/Y", strtotime($pick_date));

$sql_callpicking = "SELECT * FROM wp_callpicking WHERE recall_cloture != 'Oui' ORDER BY sickness DESC, urgent DESC, pick_date ASC, pick_heure ASC"; 

// on envoie la requête
$req_callpicking = mysql_query($sql_callpicking) or die('Erreur SQL !<br>'.$sql_callpicking.'<br>'.mysql_error());

//on obtient le resultat
$res_callpicking = mysql_num_rows($req_callpicking);

//nombre de recalls à faire
$sql_count_todo = "SELECT count(id) FROM wp_callpicking WHERE recall_cloture != 'Oui'"; 

$req_count_todo = mysql_query($sql_count_todo) or die('Erreur SQL !<br>'.$sql_count_todo.'<br>'.mysql_error()); 

$res_count_todo = mysql_fetch_row($req_count_todo);

//nombre de recalls fait
$sql_count_done = "SELECT count(id) FROM wp_callpicking WHERE recall_cloture = 'Oui' AND recall_date = '2018-05-31'"; 

$req_count_done = mysql_query($sql_count_done) or die('Erreur SQL !<br>'.$sql_count_done.'<br>'.mysql_error()); 

$res_count_done = mysql_fetch_row($req_count_done);

//nombre de recalls total

$res_count_total = $res_count_todo[0]+$res_count_done[0];
?>
	   <br><br>
<center><u><b>Recall à faire :</b></u></center>
<br /><br /><br />
<table align="center" cellspacing="15">
<tr>
<td>
Id :
</td>
<td>
Date pick :
</td>
<td>
Heure pick :
</td>
<td>
Consultant pick :
</td>
<td>
Sickness :
</td>
<td>
Urgent :
</td>
<td>
Langue :
</td>
<td>
Nom :
</td>
<td>
Prénom :
</td>
<td>
Numéro de téléphone :
</td>
<td>
Adresse mail :
</td>
<td>
Remarque :
</td>
<td>
Recall :
</td>
</tr>
<?php
    while($row = mysql_fetch_array($req_callpicking)) {	
?>
<tr>
<td>
<?php echo $row["id"]; ?>
</td>
<td>
<?php echo date("d/m/Y", strtotime($row["pick_date"])); ?>
</td>
<td>
<?php echo $row["pick_heure"]; ?>
</td>
<td>
<?php echo $row["pick_consultant"]; ?>
</td>
<td>
<center><?php echo $row["sickness"]; ?></center>
</td>
<td>
<center><?php echo $row["urgent"]; ?></center>
</td>
<td>
<?php echo $row["uzk_lang"]; ?>
</td>
<td>
<?php echo $row["uzk_nom"]; ?>
</td>
<td>
<?php echo $row["uzk_prenom"]; ?>
</td>
<td>
<a href="tel:<?php echo $row["uzk_tel"]; ?>"><?php echo $row["uzk_tel"]; ?></a>
</td>
<td>
<a href="mailto:?to=<?php echo $row["uzk_mail"]; ?> &subject=Suivi%20de%20votre%20appel%20du%20<?php echo date("d/m/Y", strtotime($row["pick_date"])); ?>%20à%20<?php echo $row["pick_heure"]; ?>"> <?php echo $row["uzk_mail"]; ?> </a>
</td>
<td>
<?php echo $row["uzk_remarque"]; ?>
</td>
<td>
<center><a href="callpicking_recall.php?id=<?php echo $row["id"]; ?>" title="Faire le recall"><img src="images/recall.jpg" width="20" height="20" alt="Recall Now !" /></a></center>
</td>
</tr>
<?php 
}
?>
</table>
<br /><br />
<table align="right" cellspacing="15">
<tr>
<td>
Statut :
</td>
<td>
Recalls :
</td>
</tr>
<tr>
<td>
A faire :
</td>
<td>
<b><?php echo $res_count_todo[0]; ?></b>
</td>
</tr>
<tr>
<td>
Fait :
</td>
<td>
<b><?php echo $res_count_done[0]; ?></b>
</td>
</tr>
<tr>
<td>
Total :
</td>
<td>
<b><?php echo $res_count_total; ?></b>
</td>
</tr>
</table>
</div>
<br /><br />







Configuration: Windows / Chrome 88.0.4324.190
A voir également:

4 réponses

jordane45 Messages postés 38138 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 avril 2024 4 649
3 mars 2021 à 06:54
Bonjour


mes requêtes mysql ne s'affiche pas.

C'est à dire ?
Tu as un message d'erreur ?

Tu as testé tes requêtes directement dans phpmyadmin pour voir si elles fonctionnent ?
0
Aucun message d’erreur, c’est des select avec des variables php donc je sais pas les tester dans phpmyadmin.

Aucun des résultats des requêtes ne s’affichent.

Merci d’avance
0
jordane45 Messages postés 38138 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 avril 2024 4 649
3 mars 2021 à 09:36
Ben..
par exemple.. pour ta requête
//nombre de recalls à faire
$sql_count_todo = "SELECT count(id) FROM wp_callpicking WHERE recall_cloture != 'Oui'"; 

Tu prends ce qui est écrit dans la variable
SELECT count(id) FROM wp_callpicking WHERE recall_cloture != 'Oui'

Tu vas dans phpmyadmin
Tu ouvres l'onglet requête
Tu colle la requête
Tu clic sur le bouton Exécuter
et tu vois si elle marche

et puis tu fais pareil avec tes autres requêtes...
0
Tzmagnum Messages postés 126 Date d'inscription dimanche 9 août 2009 Statut Membre Dernière intervention 10 mai 2022
3 mars 2021 à 11:35
Cela me met :
Erreur
Affichage des lignes 0 - 0 (total de 1, Traitement en 0.0004 secondes.)

SELECT count(id) FROM wp_callpicking WHERE recall_cloture != 'Oui'


Alors qu'il y'a bien une ligne différente de Oui dans recall_cloture.


Désolé je suis débutant.

Merci d'avance
0
jordane45 Messages postés 38138 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 avril 2024 4 649
3 mars 2021 à 12:46
Sans connaitre la structre de ta table ... impossible de t'en dire plus.
Mais si dans phpmyadmin ça te marque Erreur .. c'est que ta requête n'est pas bonne quelque part ...

Pourrais tu nous fournir un DUMP sql ( structure + données ) de cette table ?
0
Tzmagnum Messages postés 126 Date d'inscription dimanche 9 août 2009 Statut Membre Dernière intervention 10 mai 2022 > jordane45 Messages postés 38138 Date d'inscription mercredi 22 octobre 2003 Statut Modérateur Dernière intervention 17 avril 2024
3 mars 2021 à 13:42
Voici le dump sql (structure + données) :

-- phpMyAdmin SQL Dump
-- version 4.6.6deb5ubuntu0.5
-- https://www.phpmyadmin.net/
--
-- Client : localhost:3306
-- Généré le : Mer 03 Mars 2021 à 13:40
-- Version du serveur : 5.7.33-0ubuntu0.18.04.1
-- Version de PHP : 5.6.40-47+ubuntu18.04.1+deb.sury.org+1

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
SET time_zone = "+00:00";


/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!40101 SET NAMES utf8mb4 */;

--
-- Base de données : `stp_tool`
--

-- --------------------------------------------------------

--
-- Structure de la table `wp_callpicking`
--

CREATE TABLE `wp_callpicking` (
`id` int(11) NOT NULL,
`uzk_lang` varchar(20) NOT NULL,
`uzk_nom` varchar(50) NOT NULL,
`uzk_prenom` varchar(50) NOT NULL,
`uzk_tel` varchar(100) NOT NULL,
`uzk_mail` varchar(150) NOT NULL,
`uzk_remarque` varchar(300) NOT NULL,
`sickness` varchar(3) NOT NULL DEFAULT 'Non',
`urgent` varchar(3) NOT NULL,
`pick_date` date NOT NULL,
`pick_heure` time NOT NULL,
`pick_consultant` varchar(50) NOT NULL,
`recall_date` date DEFAULT NULL,
`recall_heure` time DEFAULT NULL,
`recall_consultant` varchar(50) DEFAULT NULL,
`recall_conclusion` varchar(300) DEFAULT NULL,
`recall_cloture` varchar(10) DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8;

--
-- Contenu de la table `wp_callpicking`
--

INSERT INTO `wp_callpicking` (`id`, `uzk_lang`, `uzk_nom`, `uzk_prenom`, `uzk_tel`, `uzk_mail`, `uzk_remarque`, `sickness`, `urgent`, `pick_date`, `pick_heure`, `pick_consultant`, `recall_date`, `recall_heure`, `recall_consultant`, `recall_conclusion`, `recall_cloture`) VALUES
(1, 'Fr', 'Hendrickx', 'Séverine', '0473/64.12.99', 'tzmagnum@gmail.com', 'Test', '', 'Non', '2021-02-28', '00:54:47', 'Tziolopoulos Kevin', NULL, NULL, NULL, NULL, NULL);

--
-- Index pour les tables exportées
--

--
-- Index pour la table `wp_callpicking`
--
ALTER TABLE `wp_callpicking`
ADD PRIMARY KEY (`id`);

--
-- AUTO_INCREMENT pour les tables exportées
--

--
-- AUTO_INCREMENT pour la table `wp_callpicking`
--
ALTER TABLE `wp_callpicking`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
0
Tzmagnum Messages postés 126 Date d'inscription dimanche 9 août 2009 Statut Membre Dernière intervention 10 mai 2022
Modifié le 3 mars 2021 à 14:37
Solution trouvé :
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="fr" lang="fr">
<meta charset="UTF-8">
<?php
error_reporting(E_ALL);
ini_set("display_errors", 1);
header('Content-type: text/html; charset=utf-8');
include('includes/fonctions.php');
connexionbdd();

global $current_user;
      get_currentuserinfo();

$pick_date = date("Y-m-d");
$pick_heure = date("H:i:s");
$pick_date_view = date("d/m/Y", strtotime($pick_date));

$sql_callpicking = "SELECT * FROM `wp_callpicking` WHERE `recall_cloture` != 'Oui' ORDER BY sickness DESC, urgent DESC, pick_date ASC, pick_heure ASC"; 

// on envoie la requête
$req_callpicking = mysql_query($sql_callpicking) or die('Erreur SQL !<br>'.$sql_callpicking.'<br>'.mysql_error());

//on obtient le resultat
$res_callpicking = mysql_num_rows($req_callpicking);

//nombre de recalls à faire
$sql_count_todo = "SELECT count(id) FROM `wp_callpicking` WHERE `recall_cloture` != 'Oui'"; 

$req_count_todo = mysql_query($sql_count_todo) or die('Erreur SQL !<br>'.$sql_count_todo.'<br>'.mysql_error()); 

$res_count_todo = mysql_fetch_row($req_count_todo);

//nombre de recalls fait
$sql_count_done = "SELECT count(id) FROM `wp_callpicking` WHERE `recall_cloture` = 'Oui' AND recall_date = '2021-03-03'"; 

$req_count_done = mysql_query($sql_count_done) or die('Erreur SQL !<br>'.$sql_count_done.'<br>'.mysql_error()); 

$res_count_done = mysql_fetch_row($req_count_done);

//nombre de recalls total

$res_count_total = $res_count_todo[0]+$res_count_done[0];
?>
    <br><br>
<center><u><b>Recall à faire :</b></u></center>
<br /><br /><br />
<table align="center" cellspacing="15">
<tr>
<td>
Id :
</td>
<td>
Date pick :
</td>
<td>
Heure pick :
</td>
<td>
Consultant pick :
</td>
<td>
Sickness :
</td>
<td>
Urgent :
</td>
<td>
Langue :
</td>
<td>
Nom :
</td>
<td>
Prénom :
</td>
<td>
Numéro de téléphone :
</td>
<td>
Adresse mail :
</td>
<td>
Remarque :
</td>
<td>
Recall :
</td>
</tr>
<?php
    while($row = mysql_fetch_array($req_callpicking)) { 
?>
<tr>
<td>
<?php echo $row["id"]; ?>
</td>
<td>
<?php echo date("d/m/Y", strtotime($row["pick_date"])); ?>
</td>
<td>
<?php echo $row["pick_heure"]; ?>
</td>
<td>
<?php echo $row["pick_consultant"]; ?>
</td>
<td>
<center><?php echo $row["sickness"]; ?></center>
</td>
<td>
<center><?php echo $row["urgent"]; ?></center>
</td>
<td>
<?php echo $row["uzk_lang"]; ?>
</td>
<td>
<?php echo $row["uzk_nom"]; ?>
</td>
<td>
<?php echo $row["uzk_prenom"]; ?>
</td>
<td>
<a href="tel:<?php echo $row["uzk_tel"]; ?>"><?php echo $row["uzk_tel"]; ?></a>
</td>
<td>
<a href="mailto:?to=<?php echo $row["uzk_mail"]; ?> &subject=Suivi%20de%20votre%20appel%20du%20<?php echo date("d/m/Y", strtotime($row["pick_date"])); ?>%20à%20<?php echo $row["pick_heure"]; ?>"> <?php echo $row["uzk_mail"]; ?> </a>
</td>
<td>
<?php echo $row["uzk_remarque"]; ?>
</td>
<td>
<center><a href="callpicking_recall.php?id=<?php echo $row["id"]; ?>" title="Faire le recall"><img src="images/recall.jpg" width="20" height="20" alt="Recall Now !" /></a></center>
</td>
</tr>
<?php 
}
?>
</table>
<br /><br />
<table align="right" cellspacing="15">
<tr>
<td>
Statut :
</td>
<td>
Recalls :
</td>
</tr>
<tr>
<td>
A faire :
</td>
<td>
<b><?php echo $res_count_todo[0]; ?></b>
</td>
</tr>
<tr>
<td>
Fait :
</td>
<td>
<b><?php echo $res_count_done[0]; ?></b>
</td>
</tr>
<tr>
<td>
Total :
</td>
<td>
<b><?php echo $res_count_total; ?></b>
</td>
</tr>
</table>
</div>
<br /><br />
0