Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> [PHP][MySQL]Problem z bazą
ciekawy30
post
Post #1





Grupa: Zarejestrowani
Postów: 108
Pomógł: 0
Dołączył: 2.10.2009
Skąd: bydgoszcz

Ostrzeżenie: (10%)
X----


Mam taki kod:
$this_var = "<META http-equiv="Content-Type" content="text/html; charset=iso-8859-2">
<html>
<head>
<title> OSP Wudzyn Wydarzenia 2008</title>
<style type="text/css">
<!--
body {
font-family: Verdana, Arial;
font-size: 18px;
background-color: #FFCC66;
}

-->
</style>
</head>
<body>
<table border="0" cellpadding="0" cellspacing="0" width="100%">
<tr>
<td width="100%" colspan="3"></td>
</tr>
<tr>
<td width="15%" valign="top"></td>
<td width="70%" valign="top">
<?php

$db_host = 'localhost';
$db_user = 't';
$db_pass = '1';
$db_name = 'galeria';
$link = mysql_connect($db_host, $db_user, $db_pass)
or die ("Sprawdź połączenie z serwerem.");
mysql_query ('SET NAMES utf8');
mysql_query ('SET CHARACTER_SET lutf8_polish_ci');
mysql_select_db($db_name)
or die ("Baza danych nie istnieje");

$query = "SELECT zdjecie, opis FROM galeria WHERE kategoria='PUCHARY";
$sql = mysql_query($query);
while($row = mysql_fetch_array($sql))
{
print
"
<p style=\"text-indent: 2cm\">$row[zdjecie] - $row[opis]</p>
<p>$row[galeria]</p>
";
}

$results = mysql_query($query)
or die (mysql_error());

?>
</tr>
</table>
</body>
</html>
";


wyskakuje mi tak błąd: Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in C:\xampp\htdocs\OSP\puchary.php on line 43
You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''PUCHARY' at line 1


Ten post edytował ciekawy30 8.03.2010, 11:56:20
Go to the top of the page
+Quote Post

Posty w temacie


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: 22.08.2025 - 08:02