Execution requete sql prendre beaucoup de temps pour affichage
hich
-
jordane45 Messages postés 38486 Date d'inscription Statut Modérateur Dernière intervention -
jordane45 Messages postés 38486 Date d'inscription Statut Modérateur Dernière intervention -
Bonjour,
je veux faire jointure entre 5 table et afficher export json mais affichage json prendre beaucoup de temps pour affichage .
est e que il y a solution pour cette probleme?
voila code
<?php
header('Access-Control-Allow-Origin: *');
header('Content-type: application/json');
set_time_limit(0);
$connection = mysqli_connect("localhost","root","root","log") or die("Error " . mysqli_error($connection));
$sql = "select DISTINCT(p.ID) , p.post_title, p.post_content,p.post_date,p.post_modified , t.name,meta.meta_key,meta.meta_value,p.post_type,p.guid
from 2fix0r8f5_wp_posts p,2fix0r8f5_wp_term_relationships r,2fix0r8f5_wp_term_taxonomy tax , 2fix0r8f5_wp_terms t ,2fix0r8f5_wp_postmeta meta
WHERE p.ID = r.object_id AND r.term_taxonomy_id = tax.term_taxonomy_id AND t.term_id = tax.term_id AND meta.post_id = p.ID AND t.name = 'International'
GROUP BY p.ID
ORDER BY p.post_date DESC
LIMIT 50
";
$result = mysqli_query($connection, $sql) or die("Error in Selecting " . mysqli_error($connection));
$emparray = array();
while($row =mysqli_fetch_assoc($result))
{
$emparray[] = array(
'ID' => $row['ID'],
'post_title' => utf8_encode($row["post_title"]),
'post_date' => $row["post_date"],
'name' => $row["name"],
'GUID' => $row["guid"],
'post_type' => $row["post_type"],
'post_modified' => $row["post_modified"],
'post_content' => utf8_encode($row["post_content"]),
'meta_key' => $row["meta_key"],
'meta_value' => 'media.medias-presse.info/wp-content/uploads/'.($row["meta_value"])
);
}
$a = json_encode($emparray, JSON_NUMERIC_CHECK);
echo $a;
mysqli_close($connection);
?>
je veux faire jointure entre 5 table et afficher export json mais affichage json prendre beaucoup de temps pour affichage .
est e que il y a solution pour cette probleme?
voila code
<?php
header('Access-Control-Allow-Origin: *');
header('Content-type: application/json');
set_time_limit(0);
$connection = mysqli_connect("localhost","root","root","log") or die("Error " . mysqli_error($connection));
$sql = "select DISTINCT(p.ID) , p.post_title, p.post_content,p.post_date,p.post_modified , t.name,meta.meta_key,meta.meta_value,p.post_type,p.guid
from 2fix0r8f5_wp_posts p,2fix0r8f5_wp_term_relationships r,2fix0r8f5_wp_term_taxonomy tax , 2fix0r8f5_wp_terms t ,2fix0r8f5_wp_postmeta meta
WHERE p.ID = r.object_id AND r.term_taxonomy_id = tax.term_taxonomy_id AND t.term_id = tax.term_id AND meta.post_id = p.ID AND t.name = 'International'
GROUP BY p.ID
ORDER BY p.post_date DESC
LIMIT 50
";
$result = mysqli_query($connection, $sql) or die("Error in Selecting " . mysqli_error($connection));
$emparray = array();
while($row =mysqli_fetch_assoc($result))
{
$emparray[] = array(
'ID' => $row['ID'],
'post_title' => utf8_encode($row["post_title"]),
'post_date' => $row["post_date"],
'name' => $row["name"],
'GUID' => $row["guid"],
'post_type' => $row["post_type"],
'post_modified' => $row["post_modified"],
'post_content' => utf8_encode($row["post_content"]),
'meta_key' => $row["meta_key"],
'meta_value' => 'media.medias-presse.info/wp-content/uploads/'.($row["meta_value"])
);
}
$a = json_encode($emparray, JSON_NUMERIC_CHECK);
echo $a;
mysqli_close($connection);
?>
A voir également:
- Execution requete sql prendre beaucoup de temps pour affichage
- Renommer plusieurs fichiers en même temps - Guide
- Temps pour soi iphone - Guide
- Affichage double ecran - Guide
- Mode Concentration sur iPhone : pour ne pas être dérangé - Guide
- Prendre photo avec webcam - Guide