[PHP/MySQL] Foutje...

Gestart doorCaspervm4 reacties47 weergaven

5 berichten · pagina 1 van 1

Caspervm

Lid · Topicstarter

Berichten
3.030
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ello,

Ik had een portfolio scriptje gedownload om hem te editten, maar ik krijg een error als ik hem wil installeren. nopompom
Dit is de warn die ik van tevoren krijg:

Quote:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/caspervm/domains/3kinds.nl/public_html/install.php on line 6

[COLOR= #0000BB]<?php[/COLOR]
[URL="http://www.php.net/include"]include[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"config.php"[/COLOR][COLOR= #007700]);[/COLOR]

[COLOR= #0000BB]$info_query[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"SELECT * FROM "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$prefix[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"ProFolio_info ORDER BY id DESC LIMIT 0,1"[/COLOR][COLOR= #007700]);[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_num_rows"]mysql_num_rows[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$info_query[/COLOR][COLOR= #007700]) >[/COLOR] [COLOR= #0000BB]0[/COLOR][COLOR= #007700]){[/COLOR]
    [COLOR= #0000BB]$red[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Location: index.php"[/COLOR][COLOR= #007700];[/COLOR]
    [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$red[/COLOR][COLOR= #007700]);[/COLOR]
    [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Redirecting to ProFolio Index Page..."[/COLOR][COLOR= #007700]);
}[/COLOR]

[COLOR= #0000BB]$reply[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700];[/COLOR]

[URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/isset"]isset[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]submit[/COLOR][COLOR= #007700]])){[/COLOR]
    [COLOR= #0000BB]$username[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/strtolower"]strtolower[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]username[/COLOR][COLOR= #007700]]));[/COLOR]
    [COLOR= #0000BB]$password[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/strtolower"]strtolower[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]password[/COLOR][COLOR= #007700]]));[/COLOR]
    [COLOR= #0000BB]$confirm[/COLOR] [COLOR= #007700]=[/COLOR] [URL="http://www.php.net/trim"]trim[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/strtolower"]strtolower[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$_POST[/COLOR][COLOR= #007700][[/COLOR][COLOR= #DD0000]confirm[/COLOR][COLOR= #007700]]));[/COLOR]
    [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$username[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #DD0000][/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$password[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #DD0000][/COLOR] [COLOR= #007700]&&[/COLOR] [COLOR= #0000BB]$confirm[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700]){[/COLOR]
        [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$password[/COLOR] [COLOR= #007700]==[/COLOR] [COLOR= #0000BB]$confirm[/COLOR][COLOR= #007700]){[/COLOR]
            [COLOR= #FF8000]//Create Files[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/file_exists"]file_exists[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Files[/COLOR][COLOR= #007700])){[/COLOR]
                [URL="http://www.php.net/mkdir"]mkdir[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Files[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0777[/COLOR][COLOR= #007700]);
            }[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/file_exists"]file_exists[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Files_Icons[/COLOR][COLOR= #007700])){[/COLOR]
                [URL="http://www.php.net/mkdir"]mkdir[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Files_Icons[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0777[/COLOR][COLOR= #007700]);
            }[/COLOR]
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700](![/COLOR][URL="http://www.php.net/file_exists"]file_exists[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Files_Previews[/COLOR][COLOR= #007700])){[/COLOR]
                [URL="http://www.php.net/mkdir"]mkdir[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]Files_Previews[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0777[/COLOR][COLOR= #007700]);
            }[/COLOR]
            [URL="http://www.php.net/chmod"]chmod[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Files"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0777[/COLOR][COLOR= #007700]);[/COLOR]
            [URL="http://www.php.net/chmod"]chmod[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Files_Icons"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0777[/COLOR][COLOR= #007700]);[/COLOR]
            [URL="http://www.php.net/chmod"]chmod[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Files_Previews"[/COLOR][COLOR= #007700],[/COLOR] [COLOR= #0000BB]0777[/COLOR][COLOR= #007700]);[/COLOR]
            
            [COLOR= #FF8000]//Create Tables[/COLOR]
            [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"CREATE TABLE `"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$prefix[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"ProFolio_work` (
                          `id` int(8) NOT NULL auto_increment,
                          `date` varchar(14) NOT NULL default ,
                          `title` varchar(255) NOT NULL default ,
                          `type` varchar(100) NOT NULL default ,
                          `file` varchar(255) NOT NULL default ,
                          `preview` varchar(255) NOT NULL default ,
                          `icon` varchar(255) NOT NULL default ,
                          PRIMARY KEY  (`id`),
                          FULLTEXT KEY `title` (`title`,`type`)
                        ) TYPE=MyISAM AUTO_INCREMENT=1 "[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
            
            [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"CREATE TABLE `"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$prefix[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"ProFolio_info` (
                          `id` int(5) NOT NULL auto_increment,
                          `username` varchar(30) NOT NULL default ,
                          `password` varchar(30) NOT NULL default ,
                          `page_about` blob NOT NULL,
                          `page_contact` blob NOT NULL,
                          `firstname` varchar(50) NOT NULL default ,
                          `lastname` varchar(50) NOT NULL default ,
                          `email` varchar(255) NOT NULL default ,
                          `phone` varchar(50) NOT NULL default ,
                          PRIMARY KEY  (`id`)
                        ) TYPE=MyISAM AUTO_INCREMENT=1"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
                        
            [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"CREATE TABLE `"[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$prefix[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"ProFolio_customize` (
                          `id` mediumint(4) NOT NULL auto_increment,
                          `categories` text NOT NULL,
                          `color_firstname` varchar(7) NOT NULL,
                          `color_lastname` varchar(7) NOT NULL,
                          `color_links` varchar(7) NOT NULL,
                          `color_text` varchar(7) NOT NULL,
                          `color_lightbox` varchar(7) NOT NULL,
                          `color_background` varchar(7) NOT NULL,
                          `opt_backgroundimg` varchar(255) NOT NULL default ,
                          `opt_backgroundpos` varchar(50) NOT NULL default ,
                          `opt_backgroundrep` varchar(20) NOT NULL default ,
                          PRIMARY KEY  (`id`)
                        ) ENGINE=MyISAM AUTO_INCREMENT=1 ;"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
            
            [COLOR= #FF8000]//Insert Data in DBs[/COLOR]
            [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$prefix[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"ProFolio_info (username, password, firstname, lastname) VALUES ($username, $password, First, Lastname)"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
            [URL="http://www.php.net/mysql_query"]mysql_query[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"INSERT INTO "[/COLOR][COLOR= #007700].[/COLOR][COLOR= #0000BB]$prefix[/COLOR][COLOR= #007700].[/COLOR][COLOR= #DD0000]"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)"[/COLOR][COLOR= #007700])[/COLOR] or [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/mysql_error"]mysql_error[/URL][COLOR= #007700]());[/COLOR]
            
            [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][URL="http://www.php.net/file_exists"]file_exists[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]upgrade.php[/COLOR][COLOR= #007700])){[/COLOR]
                [URL="http://www.php.net/unlink"]unlink[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]upgrade.php[/COLOR][COLOR= #007700]);
            }[/COLOR]
            
            [COLOR= #FF8000]//Finish and Redirect[/COLOR]
            [COLOR= #0000BB]$red[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Location: index.php"[/COLOR][COLOR= #007700];[/COLOR]
            [URL="http://www.php.net/header"]header[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$red[/COLOR][COLOR= #007700]);[/COLOR]
            [URL="http://www.php.net/die"]die[/URL][COLOR= #007700]([/COLOR][COLOR= #DD0000]"Redirecting to ProFolio Index Page..."[/COLOR][COLOR= #007700]);
        }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
            [COLOR= #0000BB]$reply[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Your password and password confirmation did not match."[/COLOR][COLOR= #007700];
        }
    }[/COLOR] [URL="http://www.php.net/else"]else[/URL] [COLOR= #007700]{[/COLOR]
        [COLOR= #0000BB]$reply[/COLOR] [COLOR= #007700]=[/COLOR] [COLOR= #DD0000]"Please fill out a username, password and password confirmation."[/COLOR][COLOR= #007700];
    }
}[/COLOR]
?>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<title>Installing Your ProFolio</title>
<style type="text/css">
* {padding:0px; margin:0px; font-size:12px; font-family:Arial, Helvetica, sans-serif; color:#0A1528; text-align:left;}
.container {width:500px; border:12px solid #BECAFF; margin:100px auto 30px; display:block; padding:20px;}
h1 {font-size:20px; margin-bottom:10px;}
.main {line-height:20px; margin:15px 0px;}
.form {padding:20px 0px 20px 40px; margin:auto;}
.form p {margin: 8px 0px 2px; font-weight:bold;}
.form input.field {border:1px inset #555; padding:4px; font-family:Arial, Helvetica, sans-serif; width:250px;}

.footer {position:fixed; bottom:0px; right:0px; width:100%; background:url(Images/transparent80.png) repeat;}
.footer p {text-align:right; padding:3px 6px; font-size:12px;}
.footer a {color:#fff; text-decoration:none;}
</style>
</head>
<body>
    <div class="container">
        [COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/if"]if[/URL][COLOR= #007700]([/COLOR][COLOR= #0000BB]$reply[/COLOR] [COLOR= #007700]!=[/COLOR] [COLOR= #DD0000][/COLOR][COLOR= #007700]){[/COLOR] ?>
        <p style="color:#CC0000; font-weight:bold;">[COLOR= #0000BB]<?[/COLOR] [URL="http://www.php.net/echo"]echo[/URL] [COLOR= #0000BB]$reply[/COLOR][COLOR= #007700];[/COLOR] ?></p>
        [COLOR= #0000BB]<?[/COLOR] [COLOR= #007700]}[/COLOR] ?>
        <h1>Installing ProFolio...</h1>
        <div class="main">
            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. 
        </div>
        <div class="main">
            <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. Dont forget your username and password, or you wont be able to access these options of your ProFolio! Enter your desired username and password below... (<strong>Dont use</strong> apostrophes or quotation marks!)
        </div>
        <div class="main">
            <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>
        </div>
        <div class="form">
            <form action="" method="post" enctype="multipart/form-data">
                <p><strong>Your Username</strong></p>
                <input class="field" name="username" type="text" maxlength="30" />
                <p><strong>Your Password</strong></p>
                <input class="field" name="password" type="password" maxlength="30" />
                <p><strong>Confirm Your Password</strong></p>
                <input class="field" name="confirm" type="password" maxlength="30" />
                <p>&nbsp;</p>
                <input name="submit" value="&nbsp;&nbsp;Finish&nbsp;&nbsp;" type="submit"  />
            </form>
        </div>
    </div>
</body>
<div class="footer"><p><a href="http://sticktacular.com/" target="_blank">Powered By ProFolio</a></p></div>
</html>
0
Berichten
93.699
Reputatie
0
Punten
1,27
Lid sinds
Laatst gezien
zat er een sql bij heb je die geupload?
heb je connectie met mysql?
0
Caspervm

Lid · Topicstarter

Berichten
3.030
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik heb connectie met MySQL, en nee er zat geen sql bestand bij.
0
Berichten
18.482
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Verander

$info_query = mysql_query("SELECT * FROM ".$prefix."ProFolio_info ORDER BY id DESC LIMIT 0,1");


eens in

$info_query = mysql_query("SELECT * FROM ".$prefix."ProFolio_info ORDER BY id DESC LIMIT 0,1") or die(mysql_error());
0
Caspervm

Lid · Topicstarter

Berichten
3.030
Reputatie
0
Punten
0,00
Lid sinds
Laatst gezien
Ik zal het eens proberen Luuk!
0

Jouw reactie

Deel je idee, stel een vraag of help een ander verder.

Editor laden…

Praat mee met de One2xs-community.

Inloggen om te reageren