poterasal Posted March 9, 2014 Report Posted March 9, 2014 Am o baza de date si incerc sa o urc in phpmyadmin.Primesc o eroare #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 '(14) NOT NULL, cron_status enum('done','running') NOT NULL default 'done',' at line 8Iar in baza de date se afla codul care imi da eroare:CREATE TABLE phpjob_cronjobs ( cron_type enum('jobmail','resumemail','expire') NOT NULL default 'jobmail', cron_date datetime NOT NULL default '0000-00-00 00:00:00', cron_start timestamp(14) NOT NULL, cron_status enum('done','running') NOT NULL default 'done', cron_priority tinyint(1) NOT NULL default '0');Stiti ce ar trebui sa fac in cazul asta? Quote
Active Members dancezar Posted March 9, 2014 Active Members Report Posted March 9, 2014 Sterge acel (14) lasa numai timestamp Quote
poterasal Posted March 9, 2014 Author Report Posted March 9, 2014 Am sters , primesc alta eroare:ErrorSQL query:INSERT INTO `phpjob_crossnetwork` VALUES ('', 'Default Template RSS', '', 'latest_jobs', 'rss', 'english', 10, '<?xml version="1.0" encoding="iso-8859-1"?>\r\n<rss version="2.0">\r\n<channel>\r\n <title>Latest Jobs Posted</title>\r\n <link>%%HOME_LINK%%</link>\r\n <description>Latest Jobs Posted</description>\r\n <pubDate>%%today_date%%</pubDate>\r\n <generator>rss20 by %%HOME_LINK%%</generator>\r\n <webMaster>%%site_mail%%</webMaster>\r\n', '\r\n<item>\r\n <title>%%job_jobtitle%%</title>\r\n <link>%%job_link%%</link>\r\n <description>%%job_description%%</description>\r\n <pubDate>%%job_jobdate%%</pubDate>\r\n</item>\r\n', '\r\n</channel>\r\n</rss>', '\r\n<item>\r\n <title>No Job Found</title>\r\n <link>%%HOME_LINK%%</link>\r\n <description>Visit %%HOME_LINK%% to see all the jobs available</description>\r\n <pubDate>%%today_date%%</pubDate>\r\n</item>\r\n', NOW( ) , 'yes', 0, '', '');MySQL said: Documentation#1062 - Duplicate entry '0' for key 'PRIMARY' Iar codul sursa din baza de date:CREATE TABLE `phpjob_crossnetwork` ( `cross_id` int(5) NOT NULL auto_increment, `cross_name` varchar(80) NOT NULL default '', `cross_specialids` text NOT NULL, `cross_type` varchar(20) NOT NULL default '', `cross_output` enum('js','iframe','rss') NOT NULL default 'js', `cross_language` varchar(40) NOT NULL default '', `cross_display` int(5) NOT NULL default '0', `cross_header` text NOT NULL, `cross_main` text NOT NULL, `cross_footer` text NOT NULL, `cross_noresult` text NOT NULL, `cross_date` date NOT NULL default '0000-00-00', `cross_active` enum('yes','no') NOT NULL default 'yes', `cross_visit` bigint(11) NOT NULL default '0', `cross_extratype` varchar(30) NOT NULL default '', `cross_extraids` text NOT NULL, PRIMARY KEY (`cross_id`)); Quote
Active Members dancezar Posted March 9, 2014 Active Members Report Posted March 9, 2014 Cred ca ar trebui sa ii precizezi pe ce coloane sa introduca datele alea dar sa nu includa keya primara gen:INSERT INTO phpjob_crossnetwork (`cross_name`,`cross_specialids`,`cross_type`....) VALUES('Default Template RSS','',.....)Compltezi tu acolo.. Quote
aelius Posted March 9, 2014 Report Posted March 9, 2014 (edited) La tine problema sunt inregistrarile nu tabelele.mysql> create table `phpjob_cronjobs` ( -> `cron_type` enum('jobmail','resumemail','expire') NOT NULL DEFAULT 'jobmail', -> `cron_date` datetime NOT NULL DEFAULT '0000-00-00 00:00:00', -> `cron_start` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, -> `cron_status` enum('done','running') NOT NULL DEFAULT 'done', -> `cron_priority` tinyint(4) NOT NULL DEFAULT '0');Query OK, 0 rows affected (0.14 sec)mysql> describe phpjob_cronjobs;+---------------+---------------------------------------+------+-----+---------------------+-----------------------------+| Field | Type | Null | Key | Default | Extra |+---------------+---------------------------------------+------+-----+---------------------+-----------------------------+| cron_type | enum('jobmail','resumemail','expire') | NO | | jobmail | || cron_date | datetime | NO | | 0000-00-00 00:00:00 | || cron_start | timestamp | NO | | CURRENT_TIMESTAMP | on update CURRENT_TIMESTAMP || cron_status | enum('done','running') | NO | | done | || cron_priority | tinyint(4) | NO | | 0 | |+---------------+---------------------------------------+------+-----+---------------------+-----------------------------+5 rows in set (0.00 sec)mysql> CREATE TABLE `phpjob_crossnetwork` ( -> `cross_id` int(5) NOT NULL auto_increment, -> `cross_name` varchar(80) NOT NULL default '', -> `cross_specialids` text NOT NULL, -> `cross_type` varchar(20) NOT NULL default '', -> `cross_output` enum('js','iframe','rss') NOT NULL default 'js', -> `cross_language` varchar(40) NOT NULL default '', -> `cross_display` int(5) NOT NULL default '0', -> `cross_header` text NOT NULL, -> `cross_main` text NOT NULL, -> `cross_footer` text NOT NULL, -> `cross_noresult` text NOT NULL, -> `cross_date` date NOT NULL default '0000-00-00', -> `cross_active` enum('yes','no') NOT NULL default 'yes', -> `cross_visit` bigint(11) NOT NULL default '0', -> `cross_extratype` varchar(30) NOT NULL default '', -> `cross_extraids` text NOT NULL, -> PRIMARY KEY (`cross_id`) -> );Query OK, 0 rows affected (0.19 sec)mysql> describe phpjob_crossnetwork;+------------------+---------------------------+------+-----+------------+----------------+| Field | Type | Null | Key | Default | Extra |+------------------+---------------------------+------+-----+------------+----------------+| cross_id | int(5) | NO | PRI | NULL | auto_increment || cross_name | varchar(80) | NO | | | || cross_specialids | text | NO | | NULL | || cross_type | varchar(20) | NO | | | || cross_output | enum('js','iframe','rss') | NO | | js | || cross_language | varchar(40) | NO | | | || cross_display | int(5) | NO | | 0 | || cross_header | text | NO | | NULL | || cross_main | text | NO | | NULL | || cross_footer | text | NO | | NULL | || cross_noresult | text | NO | | NULL | || cross_date | date | NO | | 0000-00-00 | || cross_active | enum('yes','no') | NO | | yes | || cross_visit | bigint(11) | NO | | 0 | || cross_extratype | varchar(30) | NO | | | || cross_extraids | text | NO | | NULL | |+------------------+---------------------------+------+-----+------------+----------------+Solutia: - Editezi dump-ul (fisierul pe care vrei sa-l importi) si adaugi al fiecare insert 'ignore'.ExempluDin asta al tau:INSERT INTO `phpjob_crossnetwork` In asta:INSERT IGNORE INTO `phpjob_crossnetwork`Si aici avem un manual dragalas: https://dev.mysql.com/doc/refman/5.5/en/insert.html Edited March 9, 2014 by aelius Quote
poterasal Posted March 9, 2014 Author Report Posted March 9, 2014 Si ce as putea face in cazul asta , am nevoie de baza asta de date mai ceva ca biblia ! Quote
aelius Posted March 9, 2014 Report Posted March 9, 2014 Mai lupta-te cu ea. Daca nu reusesti pana deseara, dai un semn si te ajut eu. Quote
poterasal Posted March 9, 2014 Author Report Posted March 9, 2014 Da-mi PM cu id-ul tau sau ceva in care putem lua legatura. Quote
Active Members dancezar Posted March 9, 2014 Active Members Report Posted March 9, 2014 Insertu ala modifa-l cum ti-am spus mai sus, specifica coloanele dar sa nu includa keia primara.Uite cum ar trebui sa arateINSERT INTO `phpjob_crossnetwork` (`cross_name`,`cross_specialids`,`cross_type`,`cross_output`,`cross_language`,`cross_display`,`cross_header`,`cross_main`,`cross_footer`,`cross_noresult`,`cross_date`,`cross_active`,`cross_visit`,`cross_extratype`,`cross_extraids`)VALUES ( 'Default Template RSS', '', 'latest_jobs', 'rss', 'english', 10, '<?xml version="1.0" encoding="iso-8859-1"?>\r\n<rss version="2.0">\r\n<channel>\r\n <title>Latest Jobs Posted</title>\r\n <link>%%HOME_LINK%%</link>\r\n <description>Latest Jobs Posted</description>\r\n <pubDate>%%today_date%%</pubDate>\r\n <generator>rss20 by %%HOME_LINK%%</generator>\r\n <webMaster>%%site_mail%%</webMaster>\r\n', '\r\n<item>\r\n <title>%%job_jobtitle%%</title>\r\n <link>%%job_link%%</link>\r\n <description>%%job_description%%</description>\r\n <pubDate>%%job_jobdate%%</pubDate>\r\n</item>\r\n', '\r\n</channel>\r\n</rss>', '\r\n<item>\r\n <title>No Job Found</title>\r\n <link>%%HOME_LINK%%</link>\r\n <description>Visit %%HOME_LINK%% to see all the jobs available</description>\r\n <pubDate>%%today_date%%</pubDate>\r\n</item>\r\n', NOW( ) , 'yes', 0, '', ''); Quote
yo20063 Posted March 9, 2014 Report Posted March 9, 2014 Bagi toate datele fara cross_id, pentru ca oricum ti le pune automat pentru ca e pe autoincrement Quote
poterasal Posted March 10, 2014 Author Report Posted March 10, 2014 Am rezolvat problema cu baza de date in schimb ma lovesc de alta problema.Am facut conexiunea catre baza de date + setarile in config dar imi apar urmatoarele erori :Warning: include(DIR_SERVER_ROOTconf/db_settings.php): failed to open stream: No such file or directory in /home/livestri/public_html/main_config.php on line 24iar in main.config.php se afla urmatorul cod:include(DIR_CONFIG . 'db_settings.php');Ce este gresit in asta? Quote
aelius Posted March 10, 2014 Report Posted March 10, 2014 (edited) Am rezolvat problema cu baza de date in schimb ma lovesc de alta problema.Am facut conexiunea catre baza de date + setarile in config dar imi apar urmatoarele erori :Warning: include(DIR_SERVER_ROOTconf/db_settings.php): failed to open stream: No such file or directory in /home/livestri/public_html/main_config.php on line 24iar in main.config.php se afla urmatorul cod:include(DIR_CONFIG . 'db_settings.php');Ce este gresit in asta?Sterge linia si pune asa:include(dirname(__FILE__) . '/conf/db_settings.php');Sau asa:include($_SERVER['DOCUMENT_ROOT']."/conf/db_settings.php");Dupa informatiile tale, fisierul 'db_settings' se afla in directorul 'conf/' Edited March 10, 2014 by aelius Quote
poterasal Posted March 10, 2014 Author Report Posted March 10, 2014 Done.Fatal error: Call to undefined function bx_db_connect() in /home/user/public_html/main_config.php on line 77META Quote
SticKyWoX Posted March 10, 2014 Report Posted March 10, 2014 Done.Fatal error: Call to undefined function bx_db_connect() in /home/user/public_html/main_config.php on line 77METATu citesti macar erorile inainte sa le postezi? Quote
aelius Posted March 10, 2014 Report Posted March 10, 2014 Pai sunt doua optiuni acolo:1. Site-ul ce vrei sa-l pui e praf.2. Nu stii sa-l configurezi.Eu vreau sa te ajut, dar mi-e imposibil sa iti dau mai multe hint-uri pentru ca nu pot decat sa-mi imaginez ce e acolo. Daca doresti ajutor direct sa-l faci, te sfatuiesc sa contactezi un om de pe aici care se ocupa cu programarea php.Iti recomand pe @eusimplu ; Eu am altele pe cap. Quote
Silviu Posted March 10, 2014 Report Posted March 10, 2014 Sigur ai inclus fisierul/le care contin functia aia? Daca nu iti trebuie urgent, baga mare la invatat pe gogu, else plateste pe cineva sa te ajute. Quote
eusimplu Posted March 10, 2014 Report Posted March 10, 2014 (edited) Ne poti da numele scriptului folosit ca sa te putem ajuta sugerandu-ti alte modalitati? Deoarece, analizand dupa ce erori ai intalnit, acel script nu a fost si nu este functional. Edited March 10, 2014 by eusimplu Quote
poterasal Posted March 12, 2014 Author Report Posted March 12, 2014 Va multumesc tuturor pentru ajutor , insa acel script era foarte plin de erori. Am rezolvat schimband scriptul. Quote