Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Problem - skrypt nie działa
amaze
post
Post #1





Grupa: Zarejestrowani
Postów: 4
Pomógł: 0
Dołączył: 12.07.2005

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


Witam,

Mam pewnie banalny problem, ale nie mogłem się doszukać na forum. Mam skrypt:

  1. <?
  2. // newssetup.php
  3.  
  4. // Attempt to connect to the MySQL server
  5. $link = @mysql_connect(&#092;"localhost\", \"root\", \"pass\");
  6.  
  7. // If the connection was unsuccessful...
  8. if (!$link) {
  9.  
  10. // Output error information and exit
  11. print &#092;"Error connecting to database server\";
  12. }
  13.  
  14. // Attempt to create database. If successful...
  15. if (@mysql_create_db(&#092;"phpforflash\")) {
  16.  
  17. // Inform user of success
  18. print &#092;"Database created<br>n\";
  19. } else {
  20.  
  21. // Otherwise, tell user there was an error
  22. print &#092;"Couldn't create database<br>n\";
  23. }
  24.  
  25. // Attempt to select database. If successful...
  26. if (@mysql_select_db(&#092;"phpforflash\")) {
  27.  
  28. // Inform user of success
  29. print &#092;"Database selected<br>n\";
  30. } else {
  31.  
  32. // Otherwise, tell user there was an error
  33. print &#092;"Couldn't select database<br>n\";
  34. }
  35.  
  36. // Build table creation query
  37. $query = &#092;"CREATE TABLE news (
  38. newsID INTEGER AUTO_INCREMENT PRIMARY KEY,
  39. title VARCHAR(100),
  40. author VARCHAR(30),
  41. posted INTEGER,
  42. body MEDIUMTEXT)&#092;";
  43.  
  44. // Attempt to create table. If successful...
  45. if (@mysql_query($query)) {
  46.  
  47. // Inform user of success
  48. print &#092;"Table created successfully\";
  49. } else {
  50.  
  51. // Otherwise, tell user there was an error
  52. print &#092;"Error creating table\";
  53. }
  54.  
  55. // Close the connection
  56. mysql_close($link);
  57.  
  58. ?>


mam poprawnie zainstalowane Apache 2.0.54, mySQL 4.1.12a i php 5.04,
kiedy uruchamiam skrypt, nic się nie dzieje - nie otrzymuję żadnej informacji, po porstu biały ekran przeglądarki. Sprawdzałem w phpMyAdmin - baza nie została utworzona itp. Hasło wpisałem takie jak w konfiguracji mysql.

z góry dziękuję za pomoc.

pozdrawiam.

Ten post edytował amaze 12.07.2005, 11:55:00
Go to the top of the page
+Quote Post

Posty w temacie


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

 



RSS Aktualny czas: 22.08.2025 - 22:38