Forum de discussion et d'aide au php
Vous n'êtes pas identifié.
|
Regles d'utilisation des forums : pensez à toujours les respecter si vous désirez obtenir des réponses rapides. FAQ : pensez à toujours chercher dedans si la réponse à votre question est dedans. Proposez vos news : si vous avez un evenement à annoncer le chat : venez discuter de php. |
||
Salut a tous...
Alors je fait un site avec un ami et la j'ai un petit probleme avec mysql...
je voi pas d'ou vien le probleme...
Voici l'erreur:
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 '' at line 1
et la page en question est :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Plaine Page :: Bienvenue ::Journal d'infos très locales ::</title>
<style type="text/css">
<!--
body,td,th {
font-size: 10px;
color: #FFFFFF;
font-family: Verdana, Arial, Helvetica, sans-serif;
}
body {
background-color: #599649;
}
a:link {
color: #FFFFFF;
text-decoration: none;
}
a:visited {
text-decoration: none;
color: #FFFFFF;
}
a:hover {
text-decoration: underline;
color: #000000;
}
a:active {
text-decoration: none;
color: #FFFFFF;
}
.Style9 {font-size: 10px}
-->
</style>
<script language="JavaScript" type="text/JavaScript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
var p,i,x; if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
if(!x && d.getElementById) x=d.getElementById(n); return x;
}
function MM_swapImage() { //v3.0
var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->
</script>
<meta name="generator" content="Namo WebEditor v5.0(Trial)">
</head>
<body onLoad="MM_preloadImages('Images/menu_zoom_on.gif','Images/menu_evenement_on.gif','Images/menu_initiative_on.gif','Images/menu_contact_on.gif','Images/menu_forum_on.gif','Images/menu_ecrivain_on.gif','Images/menu_association_on.gif','Images/menu_accueil_on.gif');">
<table width="800" align="center">
<tr>
<td height="150" align="right" valign="middle" background="Images/logo.gif"><div align="right">
<span class="Style9"><A class=menu href="./faq.php?mode=general">Faq</A> <BR>
<BR>
<A class=menu
href="./profil.php?mode=edite">Profil</A> <BR>
<A class=menu
href="gestion_upload.php?id=1">Upload</A> <BR>
<A class=menu
href="./rechercher.php">Rechercher</A> <BR>
<A class=menu
href="./liste_membre.php">Liste des membres</A> </span><br>
</div></td>
</tr>
<tr>
<td><table width="100%" bgcolor="#67AD56" style="BORDER-RIGHT: #E7930F 1px dashed; BORDER-TOP: #E7930F 1px dashed; BORDER-LEFT: #E7930F 1px dashed; BORDER-BOTTOM: #E7930F 1px dashed" >
<tr>
<td><div align="center">
<marquee>
:: Bienvenue sur plaine page ::
</marquee>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top"><div align="center">
<table width="123" align="left" bgcolor="#599649" >
<tr>
<td width="16%"><div align="center"><a href="Accueil" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Accueil','','Images/menu_accueil_on.gif',1)"><img src="Images/menu_accueil_off.gif" name="Accueil" border="0"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Zoom sur','','Images/menu_zoom_on.gif',1)"><br>
<img src="Images/menu_zoom_off.gif" alt="93210 LA PLAINE ST DENIS" name="Zoom sur" border="0"></a><br>
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Evenement','','Images/menu_evenement_on.gif',1)"><img src="Images/menu_evenement_off.gif" alt="93210 LA PLAINE ST DENIS" name="Evenement" border="0"></a><br>
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Initiative','','Images/menu_initiative_on.gif',1)"><img src="Images/menu_initiative_off.gif" alt="93210 LA PLAINE ST DENIS" name="Initiative" border="0"></a><br>
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Evenement111','','Images/menu_ecrivain_on.gif',1)"><img src="Images/menu_ecrivain_off.gif" alt="93210 LA PLAINE ST DENIS" name="Evenement111" border="0" id="Evenement1"></a><br>
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Evenement11','','Images/menu_association_on.gif',1)"><img src="Images/menu_association_off.gif" alt="93210 LA PLAINE ST DENIS" name="Evenement11" border="0" id="Evenement1"></a><br>
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Evenement1111','','Images/menu_multimedia_on.gif',1)"><img src="Images/menu_multimedia_off.gif" alt="93210 LA PLAINE ST DENIS" name="Evenement1111" border="0" id="Evenement1"></a><br>
<a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Initiative11','','Images/menu_forum_on.gif',1)"><img src="Images/menu_forum_off.gif" alt="93210 LA PLAINE ST DENIS" name="Initiative11" border="0" id="Initiative1"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Initiative1','','Images/menu_contact_on.gif',1)"><br>
</a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Initiative111','','Images/menu_contact_on.gif',1)"><img src="Images/menu_contact_off.gif" alt="93210 LA PLAINE ST DENIS" name="Initiative111" border="0" id="Initiative1"></a><a href="#" onMouseOut="MM_swapImgRestore()" onMouseOver="MM_swapImage('Initiative1','','Images/menu_contact_on.gif',1)"> </a></div></td>
</tr>
</table>
<table width="667" >
<tr>
<td align="center" valign="top" bgcolor="#599649"
><table width="100%" bgcolor="#9BC98F" style="BORDER-RIGHT: #E7930F 1px dashed; BORDER-TOP: #E7930F 1px dashed; BORDER-LEFT: #E7930F 1px dashed; BORDER-BOTTOM: #E7930F 1px dashed" >
<tr>
<td><div align="center">PLAINE PAGE // ACCUEIL </div></td>
</tr>
</table></td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#599649"
><table width="100%" height="465" bgcolor="#9BC98F" style="BORDER-RIGHT: #E7930F 1px dashed; BORDER-TOP: #E7930F 1px dashed; BORDER-LEFT: #E7930F 1px dashed; BORDER-BOTTOM: #E7930F 1px dashed" >
<tr>
<td align="center" valign="top"><table width="100%" >
<tr>
<td colspan="2" align="left"><div align="left"><img src="Images/zoom.gif"></div></td>
</tr>
<tr>
<td colspan="2"><p align="left"><font face="Verdana" size="2">
<?require ("config.inc.php");
mysql_connect($server,$user,$pass_bd);
mysql_select_db($base);
$sql = mysql_query("SELECT * FROM news WHERE cat='zoom' ORDER BY id DESC LIMIT $from,$limit_par_page") or die(mysql_error());
while($resultat = mysql_fetch_array($sql))
{
$texte = substr ($resultat[texte], 0, 250);
echo '<table cellpadding="0" cellspacing="0">
<tr>
<td width="983"><p><B><font face="Verdana" size="2" color="#FF9900"><img src="'.$resultat['img'].'" align="left" width="140" height="120" border="0"></font></B><font face="Verdana" size="2"><b>' . $resultat['titre'] . '</b><br></font><font size="2" face="Verdana">
Publié par <i>' . $resultat['pseudo'] . ' </i>le</font><font face="Verdana" size="2">
</font><font size="2" face="Verdana"><i>' . $resultat['date'] . '</i></font><font face="Verdana" size="2"><br>'.$texte.'<br></font><a href="zoom_sur_suite.php?id='.$resultat['id'].'"><font face="Verdana" size="2">Lire la suite</font></a></p>
</td>
</tr>
</table><br>';
}?>
</font></td>
</tr>
<tr>
<td colspan="2" align="left"><div align="left"><img src="Images/evenement.gif"></div></td>
</tr>
<tr>
<td colspan="2"><p align="left"><font face="Verdana" size="2">
<?require ("config.inc.php");
mysql_connect($server,$user,$pass_bd);
mysql_select_db($base);
$sql = mysql_query("SELECT * FROM news WHERE cat='zoom' ORDER BY id DESC LIMIT $from,$limit_par_page") or die(mysql_error());
while($resultat = mysql_fetch_array($sql))
{
$texte = substr ($resultat[texte], 0, 250);
echo '<table cellpadding="0" cellspacing="0">
<tr>
<td width="983"><p><B><font face="Verdana" size="2" color="#FF9900"><img src="'.$resultat['img'].'" align="left" width="140" height="120" border="0"></font></B><font face="Verdana" size="2"><b>' . $resultat['titre'] . '</b><br></font><font size="2" face="Verdana">
Publié par <i>' . $resultat['pseudo'] . ' </i>le</font><font face="Verdana" size="2">
</font><font size="2" face="Verdana"><i>' . $resultat['date'] . '</i></font><font face="Verdana" size="2"><br>'.$texte.'<br></font><a href="view_news.php?id='.$resultat['id'].'"><font face="Verdana" size="2">Lire la suite</font></a></p>
</td>
</tr>
</table><br>';
}?>
</font></td>
</tr>
<tr>
<td align="left"><div align="left"><img src="Images/ecrivain_mini.gif"></div></td>
<td align="left"><div align="left"><img src="Images/initiative_mini.gif"></div></td>
</tr>
<tr>
<td><p align="left"><font face="Verdana" size="2"> <?require ("config.inc.php");
mysql_connect($server,$user,$pass_bd);
mysql_select_db($base);
$sql = mysql_query("SELECT * FROM news WHERE cat='zoom' ORDER BY id DESC LIMIT $from,$limit_par_page") or die(mysql_error());
while($resultat = mysql_fetch_array($sql))
{
$texte = substr ($resultat[texte], 0, 80);
echo '<table cellpadding="0" cellspacing="0">
<tr>
<td width="983"><p><B><font face="Verdana" size="2" color="#FF9900"><img src="'.$resultat['img'].'" align="left" width="140" height="120" border="0"></font></B><font face="Verdana" size="2"><b>' . $resultat['titre'] . '</b><br></font><font size="2" face="Verdana">
Publié le</font><font face="Verdana" size="2">
</font><font size="2" face="Verdana"><i>' . $resultat['date'] . '</i></font><font face="Verdana" size="2"><br>'.$texte.'<br></font><a href="view_news.php?id='.$resultat['id'].'"><font face="Verdana" size="2">Lire la suite</font></a></p>
</td>
</tr>
</table><br>';
}?>
</font></td>
<td><p align="left"><font face="Verdana" size="2">
<?require ("config.inc.php");
mysql_connect($server,$user,$pass_bd);
mysql_select_db($base);
$sql = mysql_query("SELECT * FROM news WHERE cat='zoom' ORDER BY id DESC LIMIT $from,$limit_par_page") or die(mysql_error());
while($resultat = mysql_fetch_array($sql))
{
$texte = substr ($resultat[texte], 0, 80);
echo '<table cellpadding="0" cellspacing="0">
<tr>
<td width="983"><p><B><font face="Verdana" size="2" color="#FF9900"><img src="'.$resultat['img'].'" align="left" width="140" height="120" border="0"></font></B><font face="Verdana" size="2"><b>' . $resultat['titre'] . '</b><br></font><font size="2" face="Verdana">
Publié le</font><font face="Verdana" size="2">
</font><font size="2" face="Verdana"><i>' . $resultat['date'] . '</i></font><font face="Verdana" size="2"><br>'.$texte.'<br></font><a href="view_news.php?id='.$resultat['id'].'"><font face="Verdana" size="2">Lire la suite</font></a></p>
</td>
</tr>
</table><br>';
}?>
</font></td>
</tr>
</table></td>
</tr>
</table></td>
</tr>
</table>
</div>
<div align="center"></div> </td>
</tr>
<tr>
<td><table width="100%" bgcolor="#67AD56" style="BORDER-RIGHT: #E7930F 1px dashed; BORDER-TOP: #E7930F 1px dashed; BORDER-LEFT: #E7930F 1px dashed; BORDER-BOTTOM: #E7930F 1px dashed" >
<tr>
<td><div align="center">
<marquee>
:: Bienvenue sur plaine page ::
</marquee>
</div></td>
</tr>
</table></td>
</tr>
<tr>
<td><div align="center"><img src="Images/copyright.gif" width="299" height="35"></div></td>
</tr>
</table>
</html>( critiqué pas les code lol je sai c'est pas tres propre, mais j'ai un temps limité pour le fair, donc dreamweaver powa^^' )
Donc si quelqu'un pourai m'aidé pour savoir d'ou vien le probleme se serai tres sympa, merci
Hors ligne
You have an error in your SQL syntax
ne donne pas toute ta page, mais uniquement la requete.
la, il y a plusieurs requetes dans ta page, et techniquement, je peux pas deviner laquelle genere l'erreur...
Hors ligne
<?require ("config.inc.php");
mysql_connect($server,$user,$pass_bd);
mysql_select_db($base);
$sql = mysql_query("SELECT * FROM news WHERE cat='zoom' ORDER BY id DESC LIMIT $from,$limit_par_page") or die(mysql_error());
while($resultat = mysql_fetch_array($sql))
{
$texte = substr ($resultat[texte], 0, 250);
echo '<table cellpadding="0" cellspacing="0">
<tr>
<td width="983"><p><B><font face="Verdana" size="2" color="#FF9900"><img src="'.$resultat['img'].'" align="left" width="140" height="120" border="0"></font></B><font face="Verdana" size="2"><b>' . $resultat['titre'] . '</b><br></font><font size="2" face="Verdana">
Publié par <i>' . $resultat['pseudo'] . ' </i>le</font><font face="Verdana" size="2">
</font><font size="2" face="Verdana"><i>' . $resultat['date'] . '</i></font><font face="Verdana" size="2"><br>'.$texte.'<br></font><a href="zoom_sur_suite.php?id='.$resultat['id'].'"><font face="Verdana" size="2">Lire la suite</font></a></p>
</td>
</tr>
</table><br>';
}?>Les 3 autre requette sont les meme avce la cat qui change... merci d'avance de votre aide
Dernière modification par One-Sky (30-06-2005 09:07:29)
Hors ligne
YESSS!!!!! Enfin mercii!! 4 forum d'aide que je visite pour le meme probleme et personne n'a su trouvé la reponce!! merci infiniment ![]()
@ la prochaine lol^^
Hors ligne