Ciao, volevo che gli utenti di un sito avessero come "amico" di defaul il webmaster (id n. 2).
Ho usato questo comando:
INSERT INTO `FriendList` (`ID`,`Profile`,`Check`) SELECT '2',ID,'1' FROM `Profiles` order by ID WHERE ID BETWEEN 5 AND 80000
Praticamente crea l'amico ex novo pescando tutti i profili nella tabella profiles.
e tutto funziona perfettamente.
La cosa strana però è che nel momento in cui vai sul profilo del webmaster, viene fuori un errore di database che vi posto.
Database error in ***.it
SELECT `Profiles`.* FROM `FriendList`
LEFT JOIN `Profiles` ON (`Profiles`.`ID` = `FriendList`.`Profile` AND `FriendList`.`ID` = '2' OR `Profiles`.`ID` = `FriendList`.`ID` AND `FriendList`.`Profile` = '2')
WHERE (`FriendList`.`Profile` = '2' OR `FriendList`.`ID` = '2') AND `FriendList`.`Check` = '1' ORDER BY `Profiles`.`Picture` DESC LIMIT 12
Mysql error:
Server shutdown in progress
Found error in file /home/***/public_prog/inc/profiles.inc.php
at line 94. Called db_res function
with erroneous argument #0
Qualche diagnosi?![]()