Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [MySQL][PHP]ProFolio skrypt, problem w jednej linijce
jackass17
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 24.12.2009

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


Witam już cały dzień szukam odpowiedzi jak rozwiązać mój problem, a wiec.
Mam fajny skrypt ProFolio, po wrzuceniu go na host (000webhost.com) i uzupełnieniu config.php otrzymuje taki blad.
Kod
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/a1171689/public_html/install.php on line 6


config.php
  1. <?
  2. ob_start("gzip_handler");
  3.  
  4. //Change the following four items to their appropriate values (Your MySQL host, Your database username, Your database password, Database Name)
  5. $host = "mysql11.000webhost.com";
  6. $db_username = "bla napewno wpisuje poprawnie";
  7. $db_password = "bla napewno wpisuje poprawnie";
  8. $database = "bla napewno wpisuje poprawnie";
  9.  
  10. //Optional Table Prefix (Leave blank for default)
  11. $prefix = '';
  12.  
  13. //MySQL - Do not touch.
  14. mysql_connect($host, $db_username, $db_password) or die(mysql_error());
  15. mysql_select_db($database) or die(mysql_error());
  16. ?>


Install.php
  1. <?php
  2. include("config.php");
  3.  
  4. $info_query = mysql_query("SELECT * FROM ".$prefix."ProFolio_info ORDER BY id DESC LIMIT 0,1");
  5.  
  6. if(mysql_num_rows($info_query) > 0){
  7. $red = "Location: index.php";
  8. header($red);
  9. die("Redirecting to ProFolio Index Page...");
  10. }
  11.  
  12. $reply = '';
  13.  
  14. if(isset($_POST['submit'])){
  15. $username = trim(strtolower($_POST['username']));
  16. $password = trim(strtolower($_POST['password']));
  17. $confirm = trim(strtolower($_POST['confirm']));
  18. if($username != '' && $password != '' && $confirm != ''){
  19. if($password == $confirm){
  20. //Create Files
  21. if(!file_exists('Files')){
  22. mkdir('Files', 0777);
  23. }
  24. if(!file_exists('Files_Icons')){
  25. mkdir('Files_Icons', 0777);
  26. }
  27. if(!file_exists('Files_Previews')){
  28. mkdir('Files_Previews', 0777);
  29. }
  30. chmod("Files", 0777);
  31. chmod("Files_Icons", 0777);
  32. chmod("Files_Previews", 0777);
  33.  
  34. //Create Tables
  35. mysql_query("CREATE TABLE `".$prefix."ProFolio_work` (
  36. `id` int(8) NOT NULL auto_increment,
  37. `date` varchar(14) NOT NULL default '',
  38. `title` varchar(255) NOT NULL default '',
  39. `type` varchar(100) NOT NULL default '',
  40. `file` varchar(255) NOT NULL default '',
  41. `preview` varchar(255) NOT NULL default '',
  42. `icon` varchar(255) NOT NULL default '',
  43. PRIMARY KEY (`id`),
  44. FULLTEXT KEY `title` (`title`,`type`)
  45. ) TYPE=MyISAM AUTO_INCREMENT=1 ") or die(mysql_error());
  46.  
  47. mysql_query("CREATE TABLE `".$prefix."ProFolio_info` (
  48. `id` int(5) NOT NULL auto_increment,
  49. `username` varchar(30) NOT NULL default '',
  50. `password` varchar(30) NOT NULL default '',
  51. `page_about` blob NOT NULL,
  52. `page_contact` blob NOT NULL,
  53. `firstname` varchar(50) NOT NULL default '',
  54. `lastname` varchar(50) NOT NULL default '',
  55. `email` varchar(255) NOT NULL default '',
  56. `phone` varchar(50) NOT NULL default '',
  57. PRIMARY KEY (`id`)
  58. ) TYPE=MyISAM AUTO_INCREMENT=1") or die(mysql_error());
  59.  
  60. mysql_query("CREATE TABLE `".$prefix."ProFolio_customize` (
  61. `id` mediumint(4) NOT NULL auto_increment,
  62. `categories` text NOT NULL,
  63. `color_firstname` varchar(7) NOT NULL,
  64. `color_lastname` varchar(7) NOT NULL,
  65. `color_links` varchar(7) NOT NULL,
  66. `color_text` varchar(7) NOT NULL,
  67. `color_lightbox` varchar(7) NOT NULL,
  68. `color_background` varchar(7) NOT NULL,
  69. `opt_backgroundimg` varchar(255) NOT NULL default '',
  70. `opt_backgroundpos` varchar(50) NOT NULL default '',
  71. `opt_backgroundrep` varchar(20) NOT NULL default '',
  72. PRIMARY KEY (`id`)
  73. ) ENGINE=MyISAM AUTO_INCREMENT=1 ;") or die(mysql_error());
  74.  
  75. //Insert Data in DBs
  76. mysql_query("INSERT INTO ".$prefix."ProFolio_info (username, password, firstname, lastname) VALUES ('$username', '$password', 'First', 'Lastname')") or die(mysql_error());
  77. mysql_query("INSERT INTO ".$prefix."ProFolio_customize (categories, color_firstname, color_lastname, color_links, color_text, color_lightbox, color_background, opt_backgroundimg, opt_backgroundpos, opt_backgroundrep) VALUES('Artwork, Identity, Illustration, Photography, Web Designs', '#555', '#fff', '#e1e1e1', '#ebebeb', '#000', '#000', 'Backgrounds/clouds.png', 'bottom right', 'no-repeat')") or die(mysql_error());
  78.  
  79. if(file_exists('upgrade.php')){
  80. unlink('upgrade.php');
  81. }
  82.  
  83. //Finish and Redirect
  84. $red = "Location: index.php";
  85. header($red);
  86. die("Redirecting to ProFolio Index Page...");
  87. } else {
  88. $reply = "Your password and password confirmation did not match.";
  89. }
  90. } else {
  91. $reply = "Please fill out a username, password and password confirmation.";
  92. }
  93. }
  94. ?>
  95.  
  96. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  97. <html xmlns="http://www.w3.org/1999/xhtml">
  98. <head>
  99. <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
  100. <title>Installing Your ProFolio</title>
  101. <style type="text/css">
  102. * {padding:0px; margin:0px; font-size:12px; font-family:Arial, Helvetica, sans-serif; color:#0A1528; text-align:left;}
  103. .container {width:500px; border:12px solid #BECAFF; margin:100px auto 30px; display:block; padding:20px;}
  104. h1 {font-size:20px; margin-bottom:10px;}
  105. .main {line-height:20px; margin:15px 0px;}
  106. .form {padding:20px 0px 20px 40px; margin:auto;}
  107. .form p {margin: 8px 0px 2px; font-weight:bold;}
  108. .form input.field {border:1px inset #555; padding:4px; font-family:Arial, Helvetica, sans-serif; width:250px;}
  109.  
  110. .footer {position:fixed; bottom:0px; right:0px; width:100%; background:url(Images/transparent80.png) repeat;}
  111. .footer p {text-align:right; padding:3px 6px; font-size:12px;}
  112. .footer a {color:#fff; text-decoration:none;}
  113. </style>
  114. </head>
  115. <body>
  116. <div class="container">
  117. <? if($reply != ''){ ?>
  118. <p style="color:#CC0000; font-weight:bold;"><? echo $reply; ?></p>
  119. <? } ?>
  120. <h1>Installing ProFolio...</h1>
  121. <div class="main">
  122. Congratulations, you are seconds away from having your own professional digital portfolio! Thank you for choosing ProFolio to help you build your own elegant, easy-to-manage, and secure portfolio. ProFolio was started by Zach Krasner to help artists of all types display their works in a beautifully crafted webpage that is easily customized and manageable.
  123. </div>
  124. <div class="main">
  125. <strong>To get started with your ProFolio</strong>, you need to create an administrator username and password. You will need your username and password in order to login to your ProFolio to add pieces, manage your works, and edit your settings. Don't forget your username and password, or you won't be able to access these options of your ProFolio! Enter your desired username and password below... (<strong>Don't use</strong> apostrophes or quotation marks!)
  126. </div>
  127. <div class="main">
  128. <p>Once you click <strong>Finish</strong> below, your ProFolio will be created! You will be transferred to your ProFolio where you can login on the top-right of the page. Once logged in, you will full control over your portfolio and can start adding pieces to it immediately. Thanks for using ProFolio!</p>
  129. </div>
  130. <div class="form">
  131. <form action="" method="post" enctype="multipart/form-data">
  132. <p><strong>Your Username</strong></p>
  133. <input class="field" name="username" type="text" maxlength="30" />
  134. <p><strong>Your Password</strong></p>
  135. <input class="field" name="password" type="password" maxlength="30" />
  136. <p><strong>Confirm Your Password</strong></p>
  137. <input class="field" name="confirm" type="password" maxlength="30" />
  138. <p>&nbsp;</p>
  139. <input name="submit" value="&nbsp;&nbsp;Finish&nbsp;&nbsp;" type="submit" />
  140. </form>
  141. </div>
  142. </div>
  143. </body>
  144. <div class="footer"><p><a href="http://sticktacular.com/" target="_blank">Powered By ProFolio</a></p></div>
  145. </html>


tutaj jest całość dla zainteresowanych ProFolio

będę wdzieczny jeśli ktos pomoze pomoże.
Go to the top of the page
+Quote Post
skowron-line
post
Post #2





Grupa: Zarejestrowani
Postów: 4 340
Pomógł: 542
Dołączył: 15.01.2006
Skąd: Olsztyn/Warszawa

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


Zrzuć sobie zapytanie na ekran a później wklej do PMA i zobaczysz gdzie jest błąd.


--------------------
I'm so fast that last night I turned off the light switch in my hotel room and was in bed before the room was dark - Muhammad Ali.
Peg jeżeli chcesz uprawiać sex to dzieci muszą wyjść, a jeżeli chcesz żeby był dobry ty też musisz wyjść - Al Bundy.

QueryBuilder, Mootools.net, bbcradio1::MistaJam
http://www.phpbench.com/
Go to the top of the page
+Quote Post
jackass17
post
Post #3





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 24.12.2009

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


zapytanie dodałem (jeśli oto chodzi)

  1. print_r($info_query)


co to PMA ? phpMyAdmin ?

Ten post edytował jackass17 24.12.2009, 17:36:40
Go to the top of the page
+Quote Post
kingofspace
post
Post #4





Grupa: Zarejestrowani
Postów: 141
Pomógł: 4
Dołączył: 16.11.2009

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


tam pma to phpmyadmin wrzuc do niego zapytania ze skryptu zobaczysz tresc błędy pewnie Ci nietworzy sie jakas tabela

A potem być może przy sprawdzaniu czy wszystko oki pobiera niema zadnych wyników w bazie wjec funkcja mysql_num_rows() niedostae zadnego parametru i zwraca błąd
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: 20.08.2025 - 11:19