#1 2018-07-20 10:25:07

Maxime656
Invité

Erreur Mysql 1064

Bonjour,

J'ai actuellement un problème avec ma galerie Piwigo, depuis peu il affiche une erreur mysql, la voici:


Warning:  [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND ic.image_id NOT IN (152552))
  GROUP BY tag_id' at line 5


SELECT tag_id, COUNT(DISTINCT(it.image_id)) AS counter
  FROM piwigo_image_category ic
    INNER JOIN piwigo_image_tag it
    ON ic.image_id=it.image_id
   WHERE  (category_id NOT IN (19996,20005,20010,20021,20077,20099,20115,20141,20146,20153,20170,20174,20177,20197,20215,20218,20226,20252,20262,20282,20287,20305,20320,20335,20341,20350,20361,20366,20374,20379,20388,20462,20471,20485,20486,20494,20499,20508,20525,20590,20678,20679,20703,20740,20927,20951,21226,21300,21383,21423,21427,21461,21478,21490,21492,21506,21548,21587,21596,21620,21634,21641,21647,21672,21682,21684,21713,21715,21727,21770,21782,21799,21864,21868,21877,21936,21986,22017,22035,22053,22066,22081,22091,22142,22148,22194,22218,22269,22295,22321,22333,22355,22364,22377,22399,22403,22407,22445,22453,22460,22464,22479,22518,225 in /home/web/piwigo/include/dblayer/functions_mysqli.inc.php on line 845

Fatal error: Call to a member function fetch_assoc() on a non-object in /home/web/piwigo/include/dblayer/functions_mysqli.inc.php on line 893


A noter que récemment j'ai fait tourner un script qui change la variable enum "visible" à false ou true suivant les albums.
Aussi j'ai mis à jour des plugins mais je ne pense pas que ce soit lié.


Voici comment dans mon script je change la valeur "visible"

Code:

$req_update_visible = $bdd_piwigo->prepare("UPDATE piwigo_categories SET visible = :visible WHERE (id = :id)");
$req_update_visible->bindValue(':visible',"true");
$req_update_visible->bindParam(':id',$piwigo["id"]);                
$req_update_visible->execute();

Version de Piwigo:
Version de PHP:
Version de MySQL:

#2 2018-07-20 10:26:30

Maxime656
Invité

Re: Erreur Mysql 1064

Pouvez-vous m'aider ?

Merci d'avance !

#3 2018-07-20 10:44:56

Maxime656
Membre
2018-07-20
7

Re: Erreur Mysql 1064

Je viens de voir que certains avaient aussi des problèmes du au passage de la 2.9.4...


J'ai effectivement fait cette MAJ (avec d'autre maj de plugin), il y a plusieurs heures et cela fonctionnait jusqu’à maintenant.

Peut-être est-ce le problème ? Mais si c’est le cas comment je fais pour revenir à une version antérieure de piwigo sans perte de BDD et des images ?


Pour info version de php utilisé: PHP 5.4.45-0+deb7u12


Edit: j'ai testé ceci sans résultat:

Redémarrer mysql, apache, le serveur entier
mysqlcheck -r piwigo_db -u root -p (tout en OK sauf certaines qui ne supportent pas le "repair")
Allez sur la page "upgrade.php" --> Il me dit "No upgrade required, the database structure is up to date"
Désactiver les plugins via phpmyadmin --> Aucun effet

Edit 2:

Toujours ce problème
La BDD semble correct...
Aussi en allant sur une autre page comme "feed.php" par exemple j'ai une erreur légèrement différente


Warning:  [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND i.level<=1)
  GROUP BY date_available
  ORDER BY date_available DESC
  LIM' at line 6

SELECT
    date_available,
    COUNT(DISTINCT id) AS nb_elements,
    COUNT(DISTINCT category_id) AS nb_cats
  FROM piwigo_images i INNER JOIN piwigo_image_category AS ic ON id=image_id
  WHERE (ic.category_id NOT IN (19996,20005,20010,20021,20077,20099,20115,20141,20146,20153,20170,20174,20177,20197,20215,20218,20226,20252,20262,20282,20287,20305,20320,20335,20341,20350,20361,20366,20374,20379,20388,20462,20471,20485,20486,20494,20499,20508,20525,20590,20678,20679,20703,20740,20927,20951,21226,21300,21383,21423,21427,21461,21478,21490,21492,21506,21548,21587,21596,21620,21634,21641,21647,21672,21682,21684,21713,21715,21727,21770,21782,21799,21864,21868,21877,21936,21986,22017,22035,22053,22066,22081,22091,22142,22148,22194,22218,22269,22295,22321,22333,22355,22364,2 in /home/web/piwigo/include/dblayer/functions_mysqli.inc.php on line 845


Fatal error: Call to a member function fetch_assoc() on a non-object in /home/web/piwigo/include/dblayer/functions_mysqli.inc.php on line 911



Et sur certaines pages comme "profile.php" la page se charge correctement puis après quelque seconde est redirigé vers siteweb/identification.php?redirect=%252Fprofile.php avec l'erreur suivante:




Warning:  [mysql error 1064] You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ') AND ic.image_id NOT IN (152552))
  GROUP BY tag_id' at line 5

SELECT tag_id, COUNT(DISTINCT(it.image_id)) AS counter
  FROM piwigo_image_category ic
    INNER JOIN piwigo_image_tag it
    ON ic.image_id=it.image_id
   WHERE  (category_id NOT IN (19996,20005,20010,20021,20077,20099,20115,20141,20146,20153,20170,20174,20177,20197,20215,20218,20226,20252,20262,20282,20287,20305,20320,20335,20341,20350,20361,20366,20374,20379,20388,20462,20471,20485,20486,20494,20499,20508,20525,20590,20678,20679,20703,20740,20927,20951,21226,21300,21383,21423,21427,21461,21478,21490,21492,21506,21548,21587,21596,21620,21634,21641,21647,21672,21682,21684,21713,21715,21727,21770,21782,21799,21864,21868,21877,21936,21986,22017,22035,22053,22066,22081,22091,22142,22148,22194,22218,22269,22295,22321,22333,22355,22364,22377,22399,22403,22407,22445,22453,22460,22464,22479,22518,225 in /home/web/piwigo/include/dblayer/functions_mysqli.inc.php on line 845


Fatal error: Call to a member function fetch_assoc() on a non-object in /home/web/piwigo/include/dblayer/functions_mysqli.inc.php on line 893

Dernière modification par Maxime656 (2018-07-20 15:51:47)

Hors ligne

#4 2018-07-20 15:51:42

plg
Équipe Piwigo
Nantes, France, Europe
2002-04-05
12360

Re: Erreur Mysql 1064

Bonjour Maxime656,

Apparemment tu as énormément d'albums dont beaucoup d'albums privés. Cela produit une requête SQL très longue. C'est peut-être une piste pour expliquer l'origine de l'erreur. Malheureusement on ne voit pas la requête SQL dans son intégralité et ce qui nous est montré semble bon.

Peux tu ouvrir le fichier include/functions_tag.inc.php, ligne 73 (fonction get_available_tags), avant :

Code:

  $tag_counters = query2array($query, 'tag_id', 'counter');

insérer

Code:

 echo $query;

et voir ce que cela produit comme requête SQL ?


Dernier billet du blog Piwigo.com (20 juin 2019) Modus, nouveau thème par défaut sur Piwigo.com

Hors ligne

#5 2018-07-20 15:54:46

Maxime656
Membre
2018-07-20
7

Re: Erreur Mysql 1064

Merci de votre réponse rapide !

J'ai effectué l'action demandé et la requête est celle-ci:


SELECT tag_id, COUNT(DISTINCT(it.image_id)) AS counter FROM piwigo_image_category ic INNER JOIN piwigo_image_tag it ON ic.image_id=it.image_id WHERE (category_id NOT IN (19996,20005,20010,20021,20077,20099,20115,20141,20146,20153,20170,20174,20177,20197,20215,20218,20226,20252,20262,20282,20287,20305,20320,20335,20341,20350,20361,20366,20374,20379,20388,20462,20471,20485,20486,20494,20499,20508,20525,20590,20678,20679,20703,20740,20927,20951,21226,21300,21383,21423,21427,21461,21478,21490,21492,21506,21548,21587,21596,21620,21634,21641,21647,21672,21682,21684,21713,21715,21727,21770,21782,21799,21864,21868,21877,21936,21986,22017,22035,22053,22066,22081,22091,22142,22148,22194,22218,22269,22295,22321,22333,22355,22364,22377,22399,22403,22407,22445,22453,22460,22464,22479,22518,22534,22562,22575,22599,22618,22628,22636,22655,22688,22704,22711,22718,22723,22736,22740,22767,22792,22799,22803,22807,22820,22838,22869,22877,22880,22886,22903,22928,22937,22947,22956,22966,22973,23034,23042,23056,23071,23086,23099,23138,23149,23155,23160,23165,23177,23201,23234,23242,23246,23256,23264,23276,23302,23307,23317,23338,23362,23376,23389,23436,23488,23490,23504,23506,23514,23549,23551,23607,23626,23642,23644,23658,23660,23665,23683,23697,23738,23740,23753,23795,23800,23820,23861,23862,23897,23913,23916,23921,23947,23969,23975,23979,23988,23994,24015,24024,24042,24046,24099,24113,24118,24147,24152,24178,24189,24203,24213,24226,24236,24244,24253,24254,24257,24279,24289,24313,24326,24345,24380,24384,24409,24413,24436,24453,24474,24496,24516,24532,24578,24582,24592,24625,24635,24648,24658,24662,24667,24695,24731,24773,24776,24819,24826,24845,24856,24875,24885,24911,24915,24916,24933,24936,24941,24949,24981,25000,25007,25021,25099,25113,25141,25170,25193,25222,25256,25268,25272,25290,25322,25331,25411,25454,25466,25501,25517,25587,25594,25597,25601,25640,25650,25662,25681,25713,25718,25732,25740,25749,25764,25770,25837,25854,25881,25959,25964,25990,26063,26080,26123,26165,26171,26181,26185,26193,26201,26238,26285,26299,26325,26336,26434,26448,26467,26500,26505,26535,26553,26624,26635,26646,26651,26660,26676,26679,26683,26696,26705,26732,26740,26749,26808,26866,26885,26891,26894,26903,26913,26932,26940,26958,26968,26980,26988,27007,27036,27050,27066,27070,27087,27103,27107,27113,27165,27168,27185,27214,27229,27236,27239,27245,27254,27272,27281,27290,27313,27316,27334,27340,27379,27407,27430,27446,27449,27469,27496,27505,27647,27679,27683,27696,27712,27726,27741,27770,27826,27854,27867,27889,27915,27928,27953,27997,28014,28020,28036,28046,28053,28062,28079,28089,28104,28154,28160,28185,28261,28305,28323,28341,28361,28394,28396,28399,28411,28422,28433,28466,28471,28475,28485,28493,28513,28514,28523,28549,28554,28557,28564,28579,28611,28618,28641,28645,28649,28659,28670,28682,28691,28698,28713,28721,28727,28728,28730,28789,28796,28808,28816,28822,28825,28827,28846,28867,28887,28891,28898,28904,28918,28930,28948,28952,28954,28962,28970,28993,28999,29001,29016,29026,29029,29041,29045,29057,29063,29071,29077,29085,29097,29124,29127,29137,29141,29145,29162,29189,29192,29211,29215,29221,29225,29249,29258,29281,29329,29337,29338,29345,29350,29353,29358,29370,29389,29422,29433,29437,29445,29453,29460,29515,29561,29569,29577,29588,29596,29613,29627,29637,29645,29654,29658,29682,29691,29697,29736,29741,29746,29753,29764,29768,29780,29796,29805,29808,29820,29833,29839,29862,29866,29888,29899,29905,29920,29929,29946,29991,30019,30027,30056,30074,30127,30144,30150,30151,30188,30198,30235,30248,30252,30265,30270,30272,30340,30363,30379,30383,30388,30395,30440,30453,30456,30490,30521,30525,30529,30533,30574,30602,30606,30617,30627,30636,30652,30661,30700,30710,30717,30736,30745,30754,30781,30793,30798,30803,30810,30833,30848,30851,30872,30877,30908,30911,30919,30935,30956,30975,30980,30983,31010,31034,31073,31087,31114,31157,31170,31179,31190,31193,31210,31213,31230,31233,31238,31239,31278,31283,31286,31293,31305,31308,31311,31318,31333,31336,31341,31345,31348,31351,31355,31363,31374,31384,31400,31408,31416,31422,31438,31448,31459,31462,31467,31472,31475,31481,31486,31493,31496,31501,31509,31520,31527,31531,31555,31562,31571,31622,31649,31688,31732,31750,31775,31829,31838,31865,31872,31890,23911,23917,23918,23919,23923,23924,23925,23928,23931,23936,23937,23940,23941,23942,23943,23944,23945,23948,23955,23957,23960,23961,23963,23966,23976,23980,23981,23982,23985,23986,23990,23991,23992,23995,23998,24001,24004,24006,24009,24010,24011,24013,24016,24017,24018,24026,24027,24030,24039,24040,24043,24047,24050,24051,24061,24064,24067,24068,24069,24071,24072,24074,24077,24078,24079,24084,24089,24090,24092,24093,24097,24100,24102,24107,24108,24109,24110,24111,24116,24119,24120,24121,24122,24124,24127,24129,24132,24135,24143,24145,24149,24150,24157,24159,24160,24161,24165,24166,24168,24169,24170,24173,24179,24182,24183,24185,24186,24187,24192,24193,24195,24198,24204,24207,24210,24216,24220,24222,24223,24227,24233,24234,24238,24239,24242,24248,27503,27504,27506,27507,27508,27509,27510,27511,27512,27513,27514,27515,27516,27517,27518,27519,27520,27521,27522,27523,27524,27525,27526,27527,27528,27529,27530,27531,27532,27533,27534,27535,27536,27537,27538,27539,27540,27541,27542,27543,27544,27545,27546,27547,27548,27549,27550,27551,27552,27553,27554,27555,27556,27557,27558,27559,27560,27561,27562,27563,27564,27565,27566,27567,27568,27569,27570,27571,27572,27573,27574,27575,27576,27577,27578,27579,27580,27581,27582,27583,27584,27585,27586,27587,27588,27589,27590,27591,27592,27593,27594,27595,27596,27597,27598,27599,27600,27601,27602,27603,27604,27605,27606,27607,27608,27609,27610,27611,27612,27613,27614,27615,27616,27617,27618,27619,27620,27621,27622,27623,27624,27625,27626,27627,27628,27629,27630,27631,27632,27633,27634,27635,27636,27637,27638,27639,27640,27641,27642,27643,30234,30239,30241,30246,30249,30253,30257,30259,30260,30261,30262,30279,30282,30289,30290,30291,30292,30295,30298,30300,30305,30308,30310,30313,30315,30317,30319,30322,30325,30326,30329,30334,30335,30336,30337,30341,30347,30350,30354,30355,30356,30357,30359,30361,30367,30368,30369,30372,30376,30377,30381,30384,30389,30390,30392,30399,30400,30403,30405,30409,30412,30415,30416,30418,30420,30423,30425,30427,30428,30431,30433,30438,30441,30442,30449,30457,30459,30462,30466,30469,30471,30474,30480,30481,30482,30485,30486,30491,30492,30494,30495,30497,30498,30499,30500,30503,30505,30506,30508,30511,30513,30522,30527,30534,30536,30537,30538,30540,30542,30544,30545,30547,30548,30550,30551,30553,30554,30556,30559,30562,30565,30567,30571,30575,30576,30578,30581,30582,30583,30585,30587,30588,30590,30593,30594,30598,30600,30603,30607,30608,30611,30613,30614,30618,30619,30620,30622,30623,30624,30628,30630,30633,30637,30641,30648,30656,30276,30277,30549,30634,30635,30285,30478,30479,30568,30413,24235,24243,24128,24073,24117,23935,24096,24037,24038,24133,24134,24140,24080,24081,31479,31480,31513,31514,28984,28985,29069,29070,29120,29121,28596,28597,20185,20118,20161,20162,20160,20393,20035,20036,20399,20131,20132,20269,20270,20268,20264,20463,20464,20277,20278,20123,20328,20329,20407,20406,20408,19997,20067,20068,20084,20159,20111,20112,20051,20138,20272,20480,20481,20334,20073,20070,20074,20263,20405,20246,20247,20062,20030,20081,20150,20417,20181,20267,20280,20281,20487,20397,20027,20028,20222,20223,20204,20205,20069,20299,20300,20009,20089,20401,20398,20402,20392,20394,20400,20476,20477,20092,20085,20090,20093,20391,20125,20126,20119,20124,31096,31097,30662,31166,31167,30741,30742,30669,30670,30685,30686,31173,31174,31184,31185,30806,30807,30679,30680,30829,30830,30866,30867,30767,30768,30773,30774,30896,30897,31042,31043,30842,30843,23145,23144,23146,23130,23131,23005,23004,23006,22913,22914,23060,23061,23181,23182,23105,23106,23120,23121,23112,23113,23186,23187,23341,23342,22943,22944,22921,22922,22920,22952,22953,22959,22960,22919,23214,23213,23215,22978,23345,23346,23208,23209,23207,22895,22897,22896,22898,23333,23334,23356,23357,22980,22981,22979,23250,23251,23143,23003,23080,23081,22994,22995,23030,23031,23028,23023,23024,23295,23296,23212,23322,23093,23094,23353,23230,23231,22915,22916,23126,23125,23127,23324,23325,23323,23027,23206,22990,22991,23280,23281,23371,23372,23052,23053,23197,23198,23124,23066,23067,23272,23273,23046,23047,22054,22055,21544,21763,21762,21764,21918,21889,22023,21761,21737,22102,22103,21658,22029,21899,21900,21551,21545,21550,21552,22285,22284,22286,22013,22014,21599,21600,22161,21826,22264,22265,21739,21656,21832,21827,21822,21818,21834,21836,21745,21740,21742,21746,21738,21555,21556,21515,21516,22059,22060,21731,21732,21566,21567,21644,21645,21893,21894,21890,22140,22141,21752,21753,22075,22076,21821,22129,22283,21741,21856,21857,21831,22306,22051,22052,22118,22119,21709,22131,22130,22132,21951,21952,22230,22229,22231,21704,21705,21660,21920,21754,21755,21756,22246,21785,21786,21997,21998,22082,22083,21677,21678,22153,22154,21817,21549,21654,21534,21535,21992,21993,21662,21659,21663,21657,21661,21655,22040,22041,21929,21930,22172,22173,22232,22233,22228,22182,22183,21922,21921,21923,21919,21635,21636,21637,21976,21977,21978,21720,21721,21722,22276,22277,22278,22328,22329,22330,21524,21669,21670,22310,22031,22032,22030,22024,22236,22237,21833,22312,22311,22307,22313,22167,22168,22169,21578,21579,21576,21577,21580,22250,22251,22247,22248,22252,22104,22105,22106,21527,21525,21528,21529,21526,22113,22114,22115,22164,22165,22162,21575,22208,22209,21466,21467,21462,21468,21463,31579,31580,31581,22531,22532,22533,22715,22716,22717,22381,22382,22383,22600,22601,22602,22472,22473,22474,22519,22520,22411,22412,22413,22541,22454,22455,22356,22417,22832,22833,22834,22435,22436,22433,22430,22427,22420,22418,22421,22422,22419,22771,22772,22538,22539,22753,22754,22432,22434,22566,22567,22682,22683,22662,22664,22609,22610,22611,22438,22439,22440,22652,22653,22494,22495,22761,22762,22763,22509,22374,22375,22372,22426,22744,22745,22746,22512,22510,22513,22371,22373,22665,22663,22666,22698,22699,22700,22544,22542,22545,22546,22543,22429,22730,22731,22732,22361,22362,22363,22523,22524,22640,22641,22685,22686,22687,22866,22867,22868,22457,22458,22459,22559,22560,24706,24707,24554,24555,24276,24277,24346,21091,21092,21093,21001,20993,20999,20996,21002,21003,20994,20997,21082,20946,20947,20944,20941,20942,20945,20948,20784,20785,20774,20779,20782,20775,20780,20786,20541,20663,20658,20655,20661,20664,20662,20656,20659,20665,20897,20898,20899,21048,21049,21046,21043,21050,21047,21044,21106,21107,21104,21101,21168,21169,21170,21289,21290,21284,21287,21288,21285,21291,21100,20909,20904,20910,20907,20911,20908,21379,21375,21380,20861,20862,20863,20552,21160,21158,21161,21162,20745,20746,20747,21318,21316,21319,21311,21320,21310,21241,21239,21236,21242,21240,21237,21243,20928,21360,21184,21182,21185,21177,20726,21301,20931,21019,21417,21415,21418,21412,21413,21416,21419,20850,20555,20542,20556,20553,20550,20547,20557,20522,20540,20534,20543,20514,20551,20554,20537,20519,21157,20517,21252,21022,20796,20794,20797,20791,20969,20708,20709,20710,21304,21305,21296,21302,21306,21303,20657,21374,21359,21376,21365,21373,21368,21362,20695,20690,20693,20687,20684,20696,20694,20697,20688,20685,20691,21340,21342,20808,20621,20616,20622,20619,20617,20623,20620,20853,20854,20851,20852,20855,21414,21057,21028,20502,20934,20920,20923,20929,20932,20935,20936,20930,20933,20924,21286,21054,21176,20692,20958,20790,20792,20603,20838,21366,21367,21364,21361,21358,21025,21402,20972,20995,21109,20606,20630,21010,21139,21138,21141,20940,21045,20573,20943,20618,21192,20686,20532,20567,20826,21060,20832,20827,20830,20833,20834,20828,20615,20505,20503,20506,20500,20507,20501,20504,20598,20595,20599,20596,20925,20926,21179,21180,20771,21147,20984,20985,20875,20877,21439,20903,20998,20870,21074,21067,21075,21064,21058,21061,21055,21072,20978,20979,20976,20970,20973,21118,21315,21317,21142,21140,21137,21143,20829,20627,20546,21448,20793,20564,21390,21391,21388,20535,20521,20530,20536,20513,20533,20518,20922,21063,21431,20529,20654,20781,21283,20773,21112,21113,21110,21114,21111,21295,21016,21014,21008,21017,21011,20729,20727,20730,20731,20963,20959,20956,20964,20960,20965,20957,21195,21190,21196,21193,21197,21194,21191,20609,20607,20604,20610,20611,20608,20605,21249,21357,21130,21119,21122,21125,21131,21128,21126,21129,21132,21123,21031,20975,20974,20977,20971,20881,20717,20718,20719,21408,21400,21403,21406,21409,21121,20955,20757,20579,21433,21434,21432,21435,20594,20520,20570,21343,21344,21341,20802,21326,21327,20884,21454,21449,21455,21452,21453,21456,21258,21256,21253,21250,21259,21260,21254,21257,20811,20801,20804,20807,20813,20810,20585,20586,20583,20565,20580,20577,20568,20562,20571,20574,20581,20563,20569,20578,20584,20575,20572,20587,20582,21066,20778,21007,20549,20561,21042,20906,20642,21085,21083,21086,21087,21084,21238,20669,20660,21217,21277,21278,21279,21255,21235,21227,21228,21229,21124,20576,21136,20867,21103,21105,21102,20992,21411,21399,21451,21201,21071,21068,21073,21062,20672,20673,20670,20674,20671,20844,20845,20839,20842,20846,20843,20840,20512,20633,20841,21220,21221,21218,21219,21222,20683,20760,21387,21389,20754,21034,21023,21026,21020,21035,21029,21032,21021,21024,21027,21036,21033,21030,21013,21012,21015,21009,21181,21183,21405,21401,21407,21404,20638,21204,21205,21202,21203,21206,21127,20763,20764,20755,20761,20758,20762,20756,20759,20765,21363,20814,20815,20806,20812,20803,20809,20805,21442,21440,21443,21444,21189,20919,20645,20628,20639,20646,20643,20634,20631,20635,20647,20640,20644,20632,20689,20887,20885,20888,20876,20879,20868,20882,20871,20869,20889,20886,20883,20880,20878,21149,21148,21150,20776,20772,20777,20824,20825,28202,28203,28115,28116,28343,28344,28342,28346,28347,28081,28082,28080,28084,28085,28091,28092,28090,28094,28095,28187,28188,28186,28190,28191,27728,27729,27727,27731,27732,28055,28054,28056,28058,28059,28038,28037,28039,28041,28042,28363,28364,28362,28366,28367,27955,27956,27954,27958,27959,27698,27699,27697,27701,27702,28327,28328,28325,28326,28330,28331,28162,28161,28163,28165,28166,27917,27916,27918,27920,27921,27828,27829,27827,27831,27832,27999,28000,27998,28002,28003,27714,27713,27715,27717,27718,28307,28308,28306,28310,28311,27772,27771,27773,27775,27776,27891,27892,27890,27894,27895,27685,27686,28119,28120,23407,23565,23473,23474,23762,23763,23603,23604,23703,23704,23415,23416,23766,23767,23521,23522,23743,23744,23689,23690,23395,23396,23498,23499,23442,23443,23739,23489,23643,23505,23550,23659,28442,28443,29282,29216,29236,29237,30104,30058,30059,30060,30061,30057,29660,29661,29662,29663,29659,29755,29756,29757,29758,29754,29906,29907,29797,29798,29698,29699,29456,29457,29589,29590,29392,29393,29570,29571,29646,29647,27215,27071,27108,27435,27436,25255,26451,26452,25941,25940,25942,26591,26592,25968,25969,25929,25930,25785,26386,26472,26473,26561,26562,26542,26543,26388,26387,26389,26314,26315,25945,25946,26103,26104,26269,26270,25925,25926,26368,26178,26404,25888,26245,26375,26035,25742,26145,26395,26229,26621,26086,26014,26442,26220,26458,26528,26000,25998,25869,26276,25865,26378,26379,26354,25786,25788,26021,25900,26098,25746,25936,25934,26486,26521,26570,26578,26255,26053,26358,26586,26596,25892,25782,26653,26654,) AND ic.image_id NOT IN (152552)) GROUP BY tag_id ;





+ oui j'ai beaucoup d'album, d'après mes souvenirs environs 10 000
La requête se fini par 26654,)

Dernière modification par Maxime656 (2018-07-20 15:56:23)

Hors ligne

#6 2018-07-20 16:42:53

plg
Équipe Piwigo
Nantes, France, Europe
2002-04-05
12360

Re: Erreur Mysql 1064

OK, c'est donc le ",)" qui pose problème. J'ai déjà vu ça. J'essaie de retrouver ce que j'avais fait à ce moment là, car il me semble que ce n'était pas évident.


Dernier billet du blog Piwigo.com (20 juin 2019) Modus, nouveau thème par défaut sur Piwigo.com

Hors ligne

#7 2018-07-20 16:48:21

Maxime656
Membre
2018-07-20
7

Re: Erreur Mysql 1064

Merci beaucoup !

J'attend votre réponse avec impatiente ;)

Si vous avez besoin d'autre information ou si vous voulez que j'effectue d'autre action je serais disponible.

Hors ligne

#8 2018-07-20 16:52:52

plg
Équipe Piwigo
Nantes, France, Europe
2002-04-05
12360

Re: Erreur Mysql 1064

J'ai demandé un dump de la base, par email ;-) Cela sera beaucoup plus simple pour comprendre l'origine du problème.


Dernier billet du blog Piwigo.com (20 juin 2019) Modus, nouveau thème par défaut sur Piwigo.com

Hors ligne

#9 2018-07-23 12:17:20

plg
Équipe Piwigo
Nantes, France, Europe
2002-04-05
12360

Re: Erreur Mysql 1064

OK, j'ai pu analysé la base de données. Il y a un soucis avec piwigo_categories.status. Ce champ doit être soit "public" soit "private". Or dans ton cas, il y a 5k lignes où ce champ est vide. Je vais partir du principe que ce n'est pas Piwigo qui a vidé ce champ ;-)

Comme il n'y a aucune ligne dans piwigo_user_access ou piwigo_group_access, je ne peux pas savoir quels albums étaient privés ou publics. Donc à toi de voir si tu veux:

Code:

update piwigo_categories set status='public' where status='';

ou bien

Code:

update piwigo_categories set status='private' where status='';

Ensuite il faut dire à Piwigo de réinitialiser le cache utilisateur. Pour cela, vu qu'on n'a plus accès à l'administration ou quoi que ce soit, il faut le faire en base de données :

Code:

update piwigo_user_cache set need_update='true';

Dernier billet du blog Piwigo.com (20 juin 2019) Modus, nouveau thème par défaut sur Piwigo.com

Hors ligne

#10 2018-07-23 12:27:40

Maxime656
Membre
2018-07-20
7

Re: Erreur Mysql 1064

Merci beaucoup pour ton aide, ça à l'air de fonctionner !

Effectivement je ne pense pas que ce soit piwigo qui est fait ça tout seul mais c'est quand même étrange puisque le script que j'ai exécuté ne change (normalement), que le champ "visible" !

Hors ligne

#11 2018-07-24 09:47:22

plg
Équipe Piwigo
Nantes, France, Europe
2002-04-05
12360

Re: Erreur Mysql 1064

Maxime656 a écrit:

Le problème à bien été réglé par contre le problème revient lorsque je modifie des valeurs avec mon script.

Pourtant je fais mes changements ainsi:

Code:

$bdd_piwigo->beginTransaction();
$bdd_piwigo->query('UPDATE piwigo_categories SET visible = \'true\'  WHERE id = '.$piwigo["id"].' ');
$bdd_piwigo->commit();

Par contre cette fois-ci il n'y aucun champ vide et lorsque je fait cette requête DANS phpmyadmin

Code:

UPDATE piwigo_categories SET visible = 'true' WHERE visible = 'false'

puis

Code:

update piwigo_user_cache set need_update='true';

tout revient à la normale.

L'origine du problème, c'est qu'il ne faut pas modifier directement la base de données. Il faut passer par l'API (sinon on va réinventer la roue). En l'occurence, si tu veux changer le "visible" true/false (qui correspond au verrouillage de l'album), il faut passer par un appel HTTP sur ws.php (web service = API) avec la méthode pwg.categories.setInfo. Ah non en fait désolé. Cette méthode permet de changer le "status" (public/private) mais pas le "visible". Bon du coup, dans l'immédiat, si c'est vraiment le verrouillage que tu souhaites, il faut passer par un update en base :-/

Tout changement qui va affecter la liste des albums ou photos visibles dans la galerie doit être suivi par une invalidation du cache utilisateur. C'est la fonction invalidate_user_cache, qui grosso modo fait:

Code:

truncate table piwigo_user_cache_categories;
truncate table piwigo_user_cache;

Dernier billet du blog Piwigo.com (20 juin 2019) Modus, nouveau thème par défaut sur Piwigo.com

Hors ligne

#12 2018-07-24 10:06:25

Maxime656
Membre
2018-07-20
7

Re: Erreur Mysql 1064

Ok je vois merci.

J'imagine qu'il est donc préférable que j'utilise le champ status (au final je veux juste que certains albums ne soient vu que par les administrateur).

Ainsi si je fait ceci (pris sur votre site)

http://piwigo.org/demo/ws.php?format=rest
{
    "category_id": "500",
    "name": "500",
    "status": "private"
}

L'album devrait être mi en privé instantanément ?

Par contre j'avoue ne pas bien comprendre comment utiliser l'API :/

Edit: au final ça va juste que j'ai "Access Denied" en retour de la requête mais je ne sais pas comment me "loguer" via le script

Edit2:

J'utilise la methode "pwg.session.login" pour être admin avec ce code

Code:

$url = 'http://siteweb.com/ws.php?method=pwg.session.login&format=json';
$params = array(
    'username' => 'Admin',
    'password' => '***********',
);

$ch = curl_init();
curl_setopt($ch , CURLOPT_URL, $url);
curl_setopt($ch , CURLOPT_POST, 1);
curl_setopt($ch , CURLOPT_RETURNTRANSFER, 1);
curl_setopt($ch , CURLOPT_POSTFIELDS, http_build_query($params));
curl_setopt($ch , CURLOPT_CONNECTTIMEOUT, 60);
curl_setopt($ch , CURLOPT_TIMEOUT, 60);

$result = curl_exec($ch); 
echo $result;
curl_close($ch);

Ensuite j'ai fait un pwg.session.getstatus mais je suis toujours en guest


Edit3:

Finalement j'ai réussi en utilisant

Code:

curl_setopt($ch, CURLOPT_COOKIEJAR, '/home/web/Script/cookie.txt');
curl_setopt($ch, CURLOPT_COOKIEFILE, '/home/web/Script/cookie.txt');

Par contre maintenant j'ai un autre problème (encore me direz-vous... OUI !)
Si je met un album en private alors tous ses "fils" se mettent aussi en private ... mais si je revient en public la non ...

Dernière modification par Maxime656 (2018-07-24 15:31:01)

Hors ligne

Pied de page des forums

Propulsé par FluxBB

github twitter facebook newsletter Faire un don Piwigo.org © 2002-2020 · Contact