par
Jean-Michel-Lyon » 03 avr. 2007, 21:46
Voilà, je mets mon code et le script de création de la table, si quelqu'un a la gentillesse de tester.
Merci à vous,
Voici le script de création de la table
Code : Tout sélectionner
CREATE TABLE `categories` (
`id` int(11) NOT NULL auto_increment,
`description` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
Voici le code
<?php
$dbconn = @mysql_connect('localhost', 'root', 'mdp');
if (!$dbconn)
{
die('Error connecting to DB!');
}
//if (! @mysql_select_db('letschip_lcinewdb') )
if (! @mysql_select_db('nombase') )
{
die( '<p>Unable to locate the main ' .
'database at this time.</p>' );
}
if(isset($_GET['id']))
$ID = $_GET['id'];
else
$ID = 1;
// Shipping is 3.50 per unit weight
$ship_factor = 3.5
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Browse Products</title>
<style>
<!--
.ms-color2-main { border-left-style: none; border-right-style: none; border-top-style: none;
border-bottom: 1.5pt solid black; background-color: silver }
.ms-color2-tl { font-weight: bold; color: white; border-left-style: none; border-right-style:
none; border-top-style: none; border-bottom: 1.5pt solid black;
background-color: maroon }
.ms-color2-top { font-weight: bold; color: white; border-left-style: none; border-right-style:
none; border-top-style: none; border-bottom: 1.5pt solid black;
background-color: maroon }
-->
</style>
</head>
<body bgcolor="#669900" link="#FFFF00" vlink="#FFFFFF">
<p><b><font face="Verdana" color="#FFFF00" size="5">Browse Products By Team.</font></b></p>
<table border="1" width="100%" id="table1" class="ms-color2-main">
<!-- fpstyle: 9,011111100 -->
<tr>
<?
$sql = "SELECT * from categorie";
$result = @mysql_query($sql);
while ($row = mysql_fetch_array($result))
{
?>
<td class="ms-color2-tl"><a href='browse.php?id=<?php echo($row['id']) ?>'> <?php
echo($row['description']) ?></a></td>
<?
}
?>
</tr>
</table>
<p> </p>
</body>
</html>
Voilà, je mets mon code et le script de création de la table, si quelqu'un a la gentillesse de tester.
Merci à vous,
Voici le script de création de la table
[code]
CREATE TABLE `categories` (
`id` int(11) NOT NULL auto_increment,
`description` varchar(100) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=1 ;
[/code]
Voici le code
[php]
<?php
$dbconn = @mysql_connect('localhost', 'root', 'mdp');
if (!$dbconn)
{
die('Error connecting to DB!');
}
//if (! @mysql_select_db('letschip_lcinewdb') )
if (! @mysql_select_db('nombase') )
{
die( '<p>Unable to locate the main ' .
'database at this time.</p>' );
}
if(isset($_GET['id']))
$ID = $_GET['id'];
else
$ID = 1;
// Shipping is 3.50 per unit weight
$ship_factor = 3.5
?>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<title>Browse Products</title>
<style>
<!--
.ms-color2-main { border-left-style: none; border-right-style: none; border-top-style: none;
border-bottom: 1.5pt solid black; background-color: silver }
.ms-color2-tl { font-weight: bold; color: white; border-left-style: none; border-right-style:
none; border-top-style: none; border-bottom: 1.5pt solid black;
background-color: maroon }
.ms-color2-top { font-weight: bold; color: white; border-left-style: none; border-right-style:
none; border-top-style: none; border-bottom: 1.5pt solid black;
background-color: maroon }
-->
</style>
</head>
<body bgcolor="#669900" link="#FFFF00" vlink="#FFFFFF">
<p><b><font face="Verdana" color="#FFFF00" size="5">Browse Products By Team.</font></b></p>
<table border="1" width="100%" id="table1" class="ms-color2-main">
<!-- fpstyle: 9,011111100 -->
<tr>
<?
$sql = "SELECT * from categorie";
$result = @mysql_query($sql);
while ($row = mysql_fetch_array($result))
{
?>
<td class="ms-color2-tl"><a href='browse.php?id=<?php echo($row['id']) ?>'> <?php
echo($row['description']) ?></a></td>
<?
}
?>
</tr>
</table>
<p> </p>
</body>
</html>
[/php]