Warning: mysql_select_db() expects parameter 2 to be resource et

Fermé
sernyk Messages postés 5 Date d'inscription mardi 10 juin 2014 Statut Membre Dernière intervention 13 juin 2014 - 10 juin 2014 à 22:23
sernyk Messages postés 5 Date d'inscription mardi 10 juin 2014 Statut Membre Dernière intervention 13 juin 2014 - 13 juin 2014 à 08:12
bonjour j ai développé mon site avec dreamwaver cs4 après hebergement le serveur ne prend pas en compte toute mes chaine de connection et les requete s'insertion ou d'affichage. mon hebergeur me demande d'utiliser PDO ou Mysqli comment le faire sur toutes les pages. voici un example de page:
<?php require_once('./Connections/cnxsodilog.php'); ?>
<?php require_once('./Connections/cnxsodilog.php'); ?>
<?php require_once('./Connections/cnxsodilog.php'); ?>
<?php
if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

if (!function_exists("GetSQLValueString")) {
function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "")
{
if (PHP_VERSION < 6) {
$theValue = get_magic_quotes_gpc() ? stripslashes($theValue) : $theValue;
}

$theValue = function_exists("mysql_real_escape_string") ? mysql_real_escape_string($theValue) : mysql_escape_string($theValue);

switch ($theType) {
case "text":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "long":
case "int":
$theValue = ($theValue != "") ? intval($theValue) : "NULL";
break;
case "double":
$theValue = ($theValue != "") ? doubleval($theValue) : "NULL";
break;
case "date":
$theValue = ($theValue != "") ? "'" . $theValue . "'" : "NULL";
break;
case "defined":
$theValue = ($theValue != "") ? $theDefinedValue : $theNotDefinedValue;
break;
}
return $theValue;
}
}

$currentPage = $_SERVER["PHP_SELF"];

$maxRows_Recordset1 = 10;
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
//==============================================================================
$Recordset1="";
//==============================================================================
//-----------------------------Debut--------------------------------------------
//if(!isset($_REQUEST['key']))
//{
mysql_select_db($database_cnxsodilog, $cnxsodilog);
$query_Recordset1="";
if(!isset($_REQUEST['key'])){$query_Recordset1 = "SELECT * FROM upload_liste_fichiers";}
if(isset($_REQUEST['Cat']) and !empty($_REQUEST['Cat']) )
{$query_Recordset1 = "SELECT * FROM upload_liste_fichiers";}
if(isset($_REQUEST['Cat2']) and !empty($_REQUEST['Cat2']) )
{$query_Recordset1 = "SELECT * FROM upload_liste_fichiers";}
if(isset($_REQUEST['Auteur']) and !empty($_REQUEST['Auteur']) )
{$query_Recordset1 = "SELECT * FROM upload_liste_fichiers";}
if(isset($_REQUEST['key']) and isset($_REQUEST['DateS']) and !empty($_REQUEST['DateS']) )
{
$query_Recordset1 = "SELECT * FROM upload_liste_fichiers ";
//WHERE upload_liste_fichiers.date_insert='%".$_REQUEST['DateS']."' ORDER BY date_insert ;
}


$query_limit_Recordset1 = sprintf("%s LIMIT %d, %d", $query_Recordset1, $startRow_Recordset1, $maxRows_Recordset1);
$Recordset1 = mysql_query($query_limit_Recordset1, $cnxsodilog) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);

if (isset($_GET['totalRows_Recordset1'])) {
$totalRows_Recordset1 = $_GET['totalRows_Recordset1'];
} else {
$all_Recordset1 = mysql_query($query_Recordset1);
$totalRows_Recordset1 = mysql_num_rows($all_Recordset1);
}
$totalPages_Recordset1 = ceil($totalRows_Recordset1/$maxRows_Recordset1 = 10);
$pageNum_Recordset1 = 0;
if (isset($_GET['pageNum_Recordset1'])) {
$pageNum_Recordset1 = $_GET['pageNum_Recordset1'];
}
$startRow_Recordset1 = $pageNum_Recordset1 * $maxRows_Recordset1;
//}
//-----------------------------Par Categorie----------------------------------------------------
//if(isset($_REQUEST['Cat']) and !empty($_REQUEST['Cat']) )
//{
mysql_select_db($database_cnxsodilog, $cnxsodilog);
$query_Recordset1 = "SELECT * FROM upload_liste_fichiers WHERE upload_liste_fichiers.genre='Acteur et Action' ORDER BY upload_liste_fichiers.nom_fichier";
$Recordset1 = mysql_query($query_Recordset1, $cnxsodilog) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$query_Recordset1 = "SELECT * FROM upload_liste_fichiers WHERE upload_liste_fichiers.genre='Acteur et Action' ORDER BY upload_liste_fichiers.nom_fichier";
$Recordset1 = mysql_query($query_Recordset1, $cnxsodilog) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
$query_Recordset1 = "SELECT * FROM upload_liste_fichiers WHERE upload_liste_fichiers.genre='Acteur et Action' ORDER BY upload_liste_fichiers.nom_fichier";
$Recordset1 = mysql_query($query_Recordset1, $cnxsodilog) or die(mysql_error());
$row_Recordset1 = mysql_fetch_assoc($Recordset1);
$totalRows_Recordset1 = mysql_num_rows($Recordset1);
//}
//--------------------------------Par Auteur-------------------------------------------------
//if(isset($_REQUEST['Auteur']) and !empty($_REQUEST['Auteur']) )
//{
mysql_select_db($database_cnxsodilog, $cnxsodilog);
$query_Recordset2 = "SELECT count( *) as Nbre, upload_liste_fichiers.nom_expediteur, upload_liste_fichiers.id_fichier FROM upload_liste_fichiers GROUP BY upload_liste_fichiers.nom_expediteur";
$Recordset2 = mysql_query($query_Recordset2, $cnxsodilog) or die(mysql_error());
$row_Recordset2 = mysql_fetch_assoc($Recordset2);
$totalRows_Recordset2 = mysql_num_rows($Recordset2);
//}
//-----------------------------------Par ?----------------------------------------------
//if(isset($_REQUEST['Cat2']) and !empty($_REQUEST['Cat2']) )
//{
mysql_select_db($database_cnxsodilog, $cnxsodilog);
$query_Recordset3 = "SELECT count(*) as nb, upload_liste_fichiers.id_fichier, upload_liste_fichiers.Categorie_fichier FROM upload_liste_fichiers GROUP BY upload_liste_fichiers.Categorie_fichier";
$Recordset3 = mysql_query($query_Recordset3, $cnxsodilog) or die(mysql_error());
$row_Recordset3 = mysql_fetch_assoc($Recordset3);
$totalRows_Recordset3 = mysql_num_rows($Recordset3);
//}
//----------------------------------Par Profil-----------------------------------------------
//if(isset($_REQUEST['Profil']) and !empty($_REQUEST['Profil']) )
//{
mysql_select_db($database_cnxsodilog, $cnxsodilog);
$query_Recordset4 = "SELECT count(*) as nomb, upload_liste_fichiers.id_fichier, upload_liste_fichiers.id_priv, user_priv.Nompriv FROM upload_liste_fichiers, user_priv WHERE user_priv.id=upload_liste_fichiers.id_priv GROUP BY user_priv.Nompriv";
$Recordset4 = mysql_query($query_Recordset4, $cnxsodilog) or die(mysql_error());
$row_Recordset4 = mysql_fetch_assoc($Recordset4);
$totalRows_Recordset4 = mysql_num_rows($Recordset4);
//}
//---------------------FIN----------------------------------------------------------
$queryString_Recordset1 = "";
if (!empty($_SERVER['QUERY_STRING'])) {
$params = explode("&", $_SERVER['QUERY_STRING']);
$newParams = array();
foreach ($params as $param) {
if (stristr($param, "pageNum_Recordset1") == false &&
stristr($param, "totalRows_Recordset1") == false) {
array_push($newParams, $param);
}
}
if (count($newParams) != 0) {
$queryString_Recordset1 = "&" . htmlentities(implode("&", $newParams));
}
}
$queryString_Recordset1 = sprintf("&totalRows_Recordset1=%d%s", $totalRows_Recordset1, $queryString_Recordset1);

//------------------------------------------------------------

?>
<!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=iso-8859-1" />
<title>download</title>
<script language="javascript" src="classe.js"></script>
<script language="javascript" src="../calendrier/latest.js" type="text/javascript"></script>
<script>
//--------------1e Date pr search Download
$(document).ready(function(){
$('#datedoc').datepicker();
$('#exampleRange').datepicker({rangeSelect: true, firstDay: 1});
});
</script>
<link rel="stylesheet" href="../calendrier/formatage.css" type="text/css" media="screen" title="Flora (Default)">
<script src="../calendrier/latest1.js"></script>

<link href="../download/download.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.prte {
font-size: 11px;
color: #000;
}
.autor {
font-size: 12px;
color: #006;
font-weight: bold;
font-style: normal;
}
.nom {
font-size: 14px;
font-weight: bold;
color: #3C0;
}
.mel {
font-size: 10px;
font-style: italic;
color: #C00;
text-decoration: blink;
}
.icoimg {
border-top-style: none;
border-right-style: none;
border-bottom-style: none;
border-left-style: none;
}
.resume {
font-family: Verdana, Geneva, sans-serif;
font-weight: normal;
font-size: 11px;
text-align: justify;
}
men {
color: #0FC;
}
men {
color: #0CF;
}
men {
}
men {
font-family: Georgia, "Times New Roman", Times, serif;
font-size: 10px;
font-style: italic;
color: #030;
background-color: #FFC;
}
.titre {
font-weight: bold;
font-size: larger;
}
#SCREEM table tr td table tr td {
font-weight: normal;
font-size: 16px;
text-align: center;
color: #03F;
font-family: Arial, Helvetica, sans-serif;
}
.de {
color: #F00;
}
-->
</style>

</head>

<body id="SCREEM">
<table width="99%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td colspan="4"><table width="99%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="12%"><img src="./img/mairie/maire2.JPG" width="93" height="85" /></td>
<td width="88%" align="center" valign="middle" class="nom"> <?php echo $row_Recordset1['genre']; ?> <img src="./img/sys/menuright.gif" width="20" height="20" /> <?php echo $row_Recordset1['Categorie_fichier']; ?></td>
</tr>
</table></td>
</tr>
<tr>

<td width="1022" colspan="2" valign="top">

<table width="100%">
<?php $colorCel="#F4F8FB"; do {?>
<tr bgcolor="#F4F8FB" >
<td width="154" rowspan="2" valign="top"><p>Version:</p>
<p><?php echo $row_Recordset1['date_insert']; ?></p></td>
<td height="35" colspan="2" align="left" valign="middle"><span class="nom"><?php echo $row_Recordset1['nom_fichier']; ?></span><br>
<span class="resume"><?php echo $row_Recordset1['resume_fichier']; ?></span></td>
<td width="197" class="autor">Auteur: <br>
<span class="prte"><?php echo $row_Recordset1['author_fichier']; ?></span></td>
<td width="84" rowspan="2" valign="top"><a href="<?php echo './include'; ?><?php echo $row_Recordset1['dir_fichier']; ?><?php echo $row_Recordset1['nom_fichier']; ?>"><img src="./img/sys/download.gif" width="49" height="46" align="middle" /></a><a href="<?php echo './include'; ?><?php echo $row_Recordset1['dir_fichier']; ?><?php echo $row_Recordset1['nom_fichier']; ?>"><br />
Télécharger</a></td>
</tr>
<tr bgcolor="#E8EFF7">
<td width="190" height="24" valign="middle"><span class="de"><em class="prte"><span class="mel">Catégorie:</span></em></span><em class="prte"><span class="mel"> <?php echo $row_Recordset1['Categorie_fichier']; ?></span></em></td>
<td width="190" valign="middle"><span class="mel"><em class="prte"><span class="mel">Mail:</span></em></span><em class="prte"> <span class="mel"><?php echo $row_Recordset1['email_expediteur']; ?></span></em></td>
<td valign="middle"><em class="prte"><span class="mel">Exp:<?php echo $row_Recordset1['nom_expediteur']; ?></span></em> </td>
</tr>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</table>
<table border="0" align="left">
<tr>
<td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, 0, $queryString_Recordset1); ?>">Premier</a>
<?php } // Show if not first page ?></td>
<td><?php if ($pageNum_Recordset1 > 0) { // Show if not first page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, max(0, $pageNum_Recordset1 - 1), $queryString_Recordset1); ?>">Précédent</a>
<?php } // Show if not first page ?></td>
<td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, min($totalPages_Recordset1, $pageNum_Recordset1 + 1), $queryString_Recordset1); ?>">Suivant</a>
<?php } // Show if not last page ?></td>
<td><?php if ($pageNum_Recordset1 < $totalPages_Recordset1) { // Show if not last page ?>
<a href="<?php printf("%s?pageNum_Recordset1=%d%s", $currentPage, $totalPages_Recordset1, $queryString_Recordset1); ?>">Dernier</a>
<?php } // Show if not last page ?></td>
</tr>
</table>

</td>
</tr>
<tr>
<td colspan="2" valign="top"><table width="100%" border="0" cellspacing="2" cellpadding="2">
<tr>
<td width="83%" valign="top"><table width="99%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="3%"><img src="./img/sys/doc.gif" width="24" height="22" /></td>
<td width="15%"> </td>
<td width="5%" align="center"> <img src="./img/sys/menuright.gif" width="20" height="20" /></td>
<td width="20%"> </td>
<td width="5%" align="center"> </td>
<td> </td>
<td width="6%" align="center"> </td>
</tr>
</table></td>
</tr>
<tr>
<td align="left" valign="top"><p align="center"> </p>

<div>
<div id="ftn1"> </div>
</div></td>
</tr>
<tr>
<td align="center" valign="top" bgcolor="#33CCFF"><strong>Pour plus d'information télécharger le document complet</strong></td>
</tr>
</table></td>
</tr>
</table>

<div id="dot0" style="position: absolute; visibility: hidden; height: 11; width: 11;"><img src="../download/bullet.gif" height=11 width=11></div>
<div id="dot1" style="position: absolute; height: 11; width: 11;"><img src="../download/bullet.gif" height=11 width=11></div>
<div id="dot2" style="position: absolute; height: 11; width: 11;"><img src="../download/bullet.gif" height=11 width=11></div>
<div id="dot3" style="position: absolute; height: 11; width: 11;"><img src="../download/bullet.gif" height=11 width=11></div>
<div id="dot4" style="position: absolute; height: 11; width: 11;"><img src="../download/bullet.gif" height=11 width=11></div>
<div id="dot5" style="position: absolute; height: 11; width: 11;"><img src="../download/bullet.gif" height=11 width=11></div>
<div id="dot6" style="position: absolute; height: 11; width: 11;"><img src="../download/bullet.gif" height=11 width=11></div>
<SCRIPT LANGUAGE="JavaScript">
<!-- Original: Philip Winston (pwinston@yahoo.com) -->
<!-- Web Site: http://members.xoom.com/ebullets -->
<!-- 'Scrolling Fix' by Troels Jakobsen <tjak@get2net.dk> -->

<!-- Begin-->
var nDots = 7;
var Xpos = 0;
var Ypos = 0;

var DELTAT = .01;
var SEGLEN = 10;
var SPRINGK = 10;
var MASS = 1;
var GRAVITY = 50;
var RESISTANCE = 10;
var STOPVEL = 0.1;
var STOPACC = 0.1;
var DOTSIZE = 11;
var BOUNCE = 0.75;
var isNetscape = navigator.appName=="Netscape";
var followmouse = true;
var dots = new Array();
init();
function init() {
var i = 0;
for (i = 0; i < nDots; i++) {
dots[i] = new dot(i);
}
if (!isNetscape) {
// I only know how to read the locations of the
// <LI> items in IE
//skip this for now
// setInitPositions(dots)
}
for (i = 0; i < nDots; i++) {
dots[i].obj.left = dots[i].X;
dots[i].obj.top = dots[i].Y;
}
if (isNetscape) {
startanimate();
} else {
// let dots sit there for a few seconds
// since they're hiding on the real bullets
setTimeout("startanimate()", 3000);
}
}
function dot(i) {
this.X = Xpos;
this.Y = Ypos;
this.dx = 0;
this.dy = 0;
if (isNetscape) {
this.obj = eval("document.dot" + i);
} else {
this.obj = eval("dot" + i + ".style");
}
}
function startanimate() {
setInterval("animate()", 20);
}
function setInitPositions(dots) {
var startloc = document.all.tags("LI");
var i = 0;
for (i = 0; i < startloc.length && i < (nDots - 1); i++) {
dots[i+1].X = startloc[i].offsetLeft
startloc[i].offsetParent.offsetLeft - DOTSIZE;
dots[i+1].Y = startloc[i].offsetTop +
startloc[i].offsetParent.offsetTop + 2*DOTSIZE;
}
dots[0].X = dots[1].X;
dots[0].Y = dots[1].Y - SEGLEN;
}
function MoveHandler(e) {
Xpos = e.pageX;
Ypos = e.pageY;
return true;
}
function MoveHandlerIE() {
Xpos = window.event.x + document.body.scrollLeft;
Ypos = window.event.y + document.body.scrollTop;
}
if (isNetscape) {
document.captureEvents(Event.MOUSEMOVE);
document.onMouseMove = MoveHandler;
} else {
document.onmousemove = MoveHandlerIE;
}
function vec(X, Y)
{
this.X = X;
this.Y = Y;
}

// adds force in X and Y to spring for dot[i] on dot[j]
function springForce(i, j, spring)
{
var dx = (dots[i].X - dots[j].X);
var dy = (dots[i].Y - dots[j].Y);
var len = Math.sqrt(dx*dx + dy*dy);
if (len > SEGLEN) {
var springF = SPRINGK * (len - SEGLEN);
spring.X += (dx / len) * springF;
spring.Y += (dy / len) * springF;
}
}
function animate() {
var start = 0;
if (followmouse) {
dots[0].X = Xpos;
dots[0].Y = Ypos;
start = 1;
}
for (i = start ; i < nDots; i++ ) {
var spring = new vec(0, 0);
if (i > 0) {
springForce(i-1, i, spring);
}
if (i < (nDots - 1)) {
springForce(i+1, i, spring);
}
var resist = new vec(-dots[i].dx * RESISTANCE, -dots[i].dy * RESISTANCE);
var accel = new vec((spring.X + resist.X)/ MASS, (spring.Y + resist.Y)/ MASS + GRAVITY);
dots[i].dx += (DELTAT * accel.X);
dots[i].dy += (DELTAT * accel.Y);
if (Math.abs(dots[i].dx) < STOPVEL &&
Math.abs(dots[i].dy) < STOPVEL &&
Math.abs(accel.X) < STOPACC &&
Math.abs(accel.Y) < STOPACC) {
dots[i].dx = 0;
dots[i].dy = 0;
}
dots[i].X += dots[i].dx;
dots[i].Y += dots[i].dy;
var height, width;
if (isNetscape) {
height = window.innerHeight + document.scrollTop;
width = window.innerWidth + document.scrollLeft;
} else {
height = document.body.clientHeight + document.body.scrollTop;
width = document.body.clientWidth + document.body.scrollLeft;
}
if (dots[i].Y >= height - DOTSIZE - 1) {
if (dots[i].dy > 0) {
dots[i].dy = BOUNCE * -dots[i].dy;
}
dots[i].Y = height - DOTSIZE - 1;
}
if (dots[i].X >= width - DOTSIZE) {
if (dots[i].dx > 0) {
dots[i].dx = BOUNCE * -dots[i].dx;
}
dots[i].X = width - DOTSIZE - 1;
}
if (dots[i].X < 0) {
if (dots[i].dx < 0) {
dots[i].dx = BOUNCE * -dots[i].dx;
}
dots[i].X = 0;
}
dots[i].obj.left = dots[i].X;
dots[i].obj.top = dots[i].Y;
}
}
// End -->
</script>

</body>
</html>
<?php
mysql_free_result($Recordset1);

mysql_free_result($Recordset2);

mysql_free_result($Recordset3);

mysql_free_result($Recordset4);
?>

2 réponses

ccmga Messages postés 18 Date d'inscription mercredi 11 juin 2014 Statut Membre Dernière intervention 17 juin 2014
11 juin 2014 à 08:24
C'est dans ton fichier ./Connections/cnxsodilog.php que les paramètres de connexion à la base sont à définir
0
sernyk Messages postés 5 Date d'inscription mardi 10 juin 2014 Statut Membre Dernière intervention 13 juin 2014
11 juin 2014 à 11:18
Bonjour voici mon nouveau fichier cnxdilog.php
<?php
$pdo = new PDO('mysql:host=localhost;dbname=c2bd', 'nyankoue', 'C2BD2014');
?>
il ne me pose plus de problème de connexion mais svp je n'arrive pas à modifier toute la page avec PDO
voici le message que ca me renvoie
Warning: mysql_query() expects parameter 2 to be resource, null given in /vdir/www.mairiebertoua2.org/var/www/vhosts/www.mairiebertoua2.org/web/include/acteur_action.php on line 99
0
ccmga Messages postés 18 Date d'inscription mercredi 11 juin 2014 Statut Membre Dernière intervention 17 juin 2014
11 juin 2014 à 18:31
tu devrais enlever ton mot de passe d'ici... ^^

modifier la page avec PDO ? qu'est-ce que ça veut dire ?
0
sernyk Messages postés 5 Date d'inscription mardi 10 juin 2014 Statut Membre Dernière intervention 13 juin 2014
11 juin 2014 à 21:21
Bonsoir ccmga,
je veux utiliser la librairie PDO ou Mysqli car mon hébergeur a désactivé mysql_select_db et mysql_query
comment modifier les multiples page de mon site qui sont semblable à celle que je vous est envoyé?
0
ccmga Messages postés 18 Date d'inscription mercredi 11 juin 2014 Statut Membre Dernière intervention 17 juin 2014
11 juin 2014 à 22:32
les fonctions mysqli sont plus proches des anciennes mysql_* par contre il n'y a plus de select_db. vos pages utilisent toutes la même base de données ?

a priori il faudrait remplacer les mysql_query par des mysqli_query
0
sernyk Messages postés 5 Date d'inscription mardi 10 juin 2014 Statut Membre Dernière intervention 13 juin 2014
13 juin 2014 à 07:31
bonjour
regarder un peu ce url http://www.mairiebertoua2.org
la mojorité des lien font apelle à la base de donné mais je n arrive pas à me connecté essayé dans login avec user: fran pasword: fran
voici ma chaine de connexion
<?php
$pdo = new PDO('mysql:host=localhost;dbname=c2bd', 'nyankoue', 'C2BD2014');
?>

j'ai également un fichier classe.js et classe.php
dans classe.php
voici comment j'ouvre une session :
$pdo = new PDO('mysql:host=localhost; dbname=c2bd', 'nyankoue', 'C2BD2014');
mysql_select_db("c2bd") or die("BD introuvable");
$cle="";
if(isset($_REQUEST['cle']) and !empty($_REQUEST['cle']))
{
$cle=($_REQUEST['cle']);
echo(getListingSearch($_REQUEST['cle']));
}
//---------------Connexion a la BD-----------------------------------------
function connectsearch()
{
$pdo = new PDO('mysql:host=localhost; dbname=c2bd', 'nyankoue', 'C2BD2014');
mysql_select_db("c2bd") or die("BD introuvable");
}
//-----------------USER Login------------------------------------
if(isset($_REQUEST['key']) and ($_REQUEST['key']=="LOGIN"))
{
print(getLoginAll("user","id","username","password",$_REQUEST['user'],$_REQUEST['pwd']));
}
0
sernyk Messages postés 5 Date d'inscription mardi 10 juin 2014 Statut Membre Dernière intervention 13 juin 2014
13 juin 2014 à 08:12
mon site fonctionne bien en local.
0