Problem men en tagwall & mysql
HejsaJeg har et problem med min tagwall, hver gang jeg klikker på tagwall, så forsvinder hele min højre side, da den kommer med en fejl
Min php sætning i tagwall filen ser sådan her ud:
<?php
//MySQL server configuration
$host = "xxxxxx"; //Enter the address to your MySQL server
$user = "xxxxx"; //Enter the user to your MySQL server
$pass = "xxxxxx"; //Enter the password to your user
$db = "xxxxxx"; //Enter the database on your MySQL server where you created the table from the structure.sql
//Do not modify anything under this line!
//Get the input typed in the form
$name = $_POST['name'];
$email = $_POST['email'];
$text = $_POST['text'];
$time = date("d/m-Y H:i:s");
//If nothing was typed in the name field, then the Name will be replaced with 'anonymous'
if ($_POST['name'] == "Name") {
$name = "Guest";
}
//If nothing was typed in the E-mail field, then the E-mail will be replaced with null@null
if ($_POST['email'] == "E-mail") {
$email = "";
}
//Connect to the MySQL server
mysql_connect("$host1", "$user1", "$pass1");
//Select a database
mysql_select_db($db1);
//If the text field isn't empty, then this code will be executed:
//If an URL was typed in the text field, then it will be replaced with <a href='http://somedomain.com'>http://somedomain.com</a>
//If an < or > has been typed, it will be replaced with < or >
//Insert the data into the MySQL database
if(!empty($_POST['text'])){
$text = ereg_replace("<", "<", $text);
$text = ereg_replace(">", ">", $text);
$text = ereg_replace("[[:alpha:]]+://[^<>[:space:]]+[[:alnum:]/]", "<a href=\"\\0\">\\0</a>", $text);
$insertSQL = "insert into tagwall (name, email, time, text) values ('$name', '$email', '$time', '$text')";
mysql_query($insertSQL);
}
//Get all the data from the MySQL database, sort by the row 'id' and limit the rows that's being printed to 20
//Make an array from the $result variable
//Convert the 'new line's to <br>
$result = mysql_query("SELECT * FROM tagwall ORDER BY id DESC LIMIT 10") or die(mysql_error());
while ($row = mysql_fetch_array($result)) {
echo "<font family='Trebuchet MS, sans-serif' size='2'><b><a href='mailto:".$row['email']."'>".$row['name']."</a></b> - ".$row['time']."<br>";
echo nl2br($row['text']);
echo "<hr>";
}
//Close the connection to the MySQL server
mysql_close();
?>
Fejlen der kommer er:
Warning: mysql_fetch_row(): supplied argument is not a valid MySQL result resource in /home/web/web4647/includes/sql_layer.php on line 36
Jeg tror det har noget med sql_layer.php at gøre, for begge filer bruger den samme linie:
Tagwall.php($row = mysql_fetch_array($result)) {
sql_layer.php - linie 36: $row = mysql_fetch_row($res);
Jeg er sikker på at det er fejlen, men kan jeg ik omskriv min tagwall.php til noget andet, men stadig få den samme effekt?
Please hjælp mig....! :S
