Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Sql, poczatki w php
-CconradD-
post
Post #1





Goście







Witam biggrin.gif .
Mam problem chce przerobic szablon php wykonany przez kogos na wlasnu użytek, ale nie moge go wogóle otworzyć. Pojawia mi się taki blad:

Warning: mysql_connect(): Unknown MySQL Server Host 'ftp' (1) in /home/www/cconradd.awardspace.com/mysql_db.inc on line 30
Cannot connect to database ftp://conradd.awardspace/cconradd.awardspace.com/ with login cconradd.

  1. http://cconradd.awardspace.com/example.php

W php mam do wypelnienie takie cos:

  1. <?php
  2. $db = new mysql_db("<DB_SERVER>", "<DB_USERNAME>", "<DB_PASSWORD>");
  3.  $moviedb = new Moviedb($db, "<DATABASE_NAME>", "<TABLE_NAME>");
  4. $moviedb->set_min_cat_num(1);
  5. $moviedb->set_lang_file("lang-french.inc");
  6. $moviedb->set_moviedb
  7. ?>

A opis taki:
* Create a dynamic view of ANT's movie database.
*
* <b> REQUIREMENTS </b>
*
* 1. PHP4+
* 2. MySQL Server 4.1+
* 3. ANT Movie Catalog export to a MySQL Database
* 4. At least some knowledge of standard HTML and php processes.
*
*
* <b> INSTRUCTIONS </b>
*
* 1. Download ANT Movie Catalog to build your movie database.
* 2. Export your Movie Database as SQL, check the option for include images.
* 3. Import the SQL into your MySQL Database on the server, and upload the images to the server.
* 4. Add the following code to the page you want this script to be displayed. Don't
* forget to also include the style sheet within the header of your HTML file.
* $db = new mysql_db("<DB_SERVER>", "<DB_USERNAME>", "<DB_PASSWORD>");
* $moviedb = new Moviedb($db, "<DATABASE_NAME>", "<TABLE_NAME>");
* print $moviedb->get_html();
* 5. There are several SET functions available which can be used to tweak the way this script
* works on your server. Include the function calls just before the print statement included
* on step four (above). The SET functions available are:
* $moviedb->set_min_cat_num($int); // Sets the Minimum number of movies before a category for that type is displayed. (Default 5)
* $moviedb->set_lang_file($filename); // Sets the language file to use (filename only, NOT path)
* $moviedb->set_moviedb_title($string); // Sets the title to be displayed at the top of the script
* $moviedb->set_default_npp($int); // Sets the number of movies per page to be displayed (Default 10)
* $moviedb->set_img_folder($http_path); // Sets the cover images directory (full HTTP path required) (Default: <script PATH>/images)
*
* *. YOU SHOULD NOT NEED TO EDIT THIS FILE AT ALL UNLESS YOU KNOW WHAT YOU ARE DOING. smile.gif

Nie wiem jak sobie z tym poradzic. Prosze o pomoc.
Go to the top of the page
+Quote Post
 
Start new topic
Odpowiedzi (1 - 5)
kszychu
post
Post #2





Grupa: Przyjaciele php.pl
Postów: 2 712
Pomógł: 23
Dołączył: 27.10.2003
Skąd: z kontowni

Ostrzeżenie: (0%)
-----


A co to za serwer ftp? Coś takiego tam wpisałeś w hosta?


--------------------
"Coś się kończy, coś się zaczyna." Andrzej Sapkowski
Go to the top of the page
+Quote Post
Cysiaczek
post
Post #3





Grupa: Moderatorzy
Postów: 4 465
Pomógł: 137
Dołączył: 26.03.2004
Skąd: Gorzów Wlkp.




Coś Ci powiem. Zanim postarasz się to uruchomić, to warto nauczyć się chociażby podstaw php. W przecuwnym wypadku bedziesz pisał na forum co chwila, bo coś Ci nie będzie działało.

Podpowiem też: <DB_SERVER> <--- musisz twe pola zastąpić poprawnymi wpisami. Zobacz, co jest napisane w panelu administracyjnum - tzn jaka jes nazwa bazy danych, twój login do niej i inne.


--------------------
To think for yourself you must question authority and
learn how to put yourself in a state of vulnerable, open-mindedness;
chaotic, confused, vulnerability, to inform yourself.
Think for yourself. Question authority.
Go to the top of the page
+Quote Post
-Gość-
post
Post #4





Goście







Zgodze sie z toba ze bez podstaw nie zmodyfikuje tego szablonu. Ale w takim razie chce go tylko uruchomic zeby dzialal. Wypelnilem to tak jak mówiles ale nadal nie dziala. Prosze tylko o doradzenie mi przy uruchomieniu tego. Wpisalem cos takiego:

  1. <?php
  2. $db = new mysql_db("db4.awardspace.com", "cconradd", "haslo");
  3. $moviedb = new Moviedb($db, "<DATABASE_NAME>", "<DATABASE_TABLE>");
  4. $moviedb->set_min_cat_num(1);
  5. $moviedb->set_lang_file("lang-french.inc");
  6. $moviedb->set_moviedb_title("Example MovieDB Setup");
  7. $moviedb->set_default_npp(5);
  8. print $moviedb->get_html();
  9. ?>


a co z tym: <DATABASE_NAME>", "<DATABASE_TABLE> questionmark.gif
Go to the top of the page
+Quote Post
-Gość-
post
Post #5





Goście







Dobra troche zrozumialem. Zarejestrowalem sie http://cp4.awardspace.com/, ale nie wiem co dalej jak dodac moja baze sql??
Go to the top of the page
+Quote Post
-Gość-
post
Post #6





Goście







Dodalem SQL. Ale nadal nie wiem co wpisac w <DATABASE_NAME>", "<DATABASE_TABLE>. Wyskauje mi cos takiego:

SELECT category,count(*) FROM `movies`.`movies` GROUP BY category
Invalid Query: SELECT command denied to user 'cconradd_conrad1'@'209.85.5.34' for table 'movies'
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 14:52