Bonsoir

Sur ce coup la j'arrive pas a comprendre:

Voici l'erreur

Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource in /home/triphotob/www/clviewcart.php on line 16

Le code php

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
<?php  
require 'includes/initialize.inc.php'; 
 
// get photo sizes and prices 
$res = mysql_query("select * from plsizes where sizeCustomUserID = 'public'"); 
while ($row = mysql_fetch_array($res)) 
    { 
    $pricesarray[$row['sizeSize']]=$row['sizePrice']; 
    $sizesarray[]=$row['sizeSize']; 
    } 
 
 
// build SQL     
 
$sql = "select * from plitems, plphotos where plphotos.phID = plitems.itemPhotoID and plitems.itemShoppingCartID = '$ppShoppingCartID'"; 
$total = mysql_num_rows(mysql_query($sql)); 
$totalcost=0; 
 
//////////////////// start output 
 
require 'header.inc.php';  
 
 
    $output .= " 
    <form action='clremovephotosfromcart.php' method='post' name='clviewcart'> 
    <input type=hidden name=accesscode value=$accesscode> 
    <p> 
    <span class=header>".$t['your shopping cart']."</span><br> 
     
    <p><a href=clviewphotos.php?accesscode=$accesscode>".$t['add more to cart']."</a></p>     
     
    "; 
 
 
// thumbnails 
 
    $res = mysql_query($sql); 
    if (mysql_num_rows($res)==0): 
    print $output.$t['no photos in shopping cart']; require 'footer.inc.php'; exit; 
    else: 
    $output .= ' 
     
    <table cellpadding=1 cellspacing=4 width=99% class="dotted"><tr class="odd">'; 
 
 
    $i = 0; 
    while ($row = mysql_fetch_array($res)) 
        { 
        $output .=  '<td><div align=left class="smalltext"> 
        <a class="smalltext" href="#" onclick="window.open(\'fullsizepreview.php?phID='.$row['phID'].'\',\'popup\',\'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=350\')"><img border=0 class=photo border=0 hspace=3 vspace=0 src=thumbnail.jpg.php?phID='.$row['phID'].'></a><br> 
        '.$t['size'].':&nbsp; 
        <strong>'.$row['itemSize'].'</strong><br> 
        '.$t['quantity'].':&nbsp; 
        <strong>'.$row['itemQuantity'].'</strong><br> 
        <input name="removefromcart[]" class="input" style="padding:0px;margin:0px;border:0px" type="checkbox" value="'.$row['itemID'] 
        .'">&nbsp;'.$t['remove'].' 
        </div></td>'; 
        $totalcost = $totalcost + ($row['itemPrice'] * $row['itemQuantity']); 
        $i = $i+1; 
        if ($i % 10 == 0): $output .= '</tr><tr class="odd">';  
        elseif ($i % 5 == 0): $output .= '</tr><tr class="even">';  endif;         
        } 
     $output .=  '</tr> 
     <tr><td colspan=5 align=right> 
     <input name="submit" class="button" type="submit" value="'.$t['remove selected photos from cart'].'"> 
     </td></tr></table>';      
    print $output; 
    endif; 
// thumbnails end     
 
    print ' 
     
    </form> 
     
     
    <table><tr><td style="width:15%"><div class=sticknote> 
     
    <strong>'.$t['Price list'].'</strong> 
    <br> 
    <br> 
    '; 
 
    foreach($sizesarray as $size) 
    {    print $size.' - <strong>€'.$pricesarray[$size].'</strong><br>';    } 
 
 
    print '</div> 
    </td><td style="width:75%; text-align: center"> 
    <div> 
    '.$t['The total cost of photos you selected is'].'&nbsp;€<strong>'.$totalcost.'</strong> 
     
    <!-- <form action="https://www.cbserver.com/secure/commande_lib.php" method="get"> --> 
    <form action="purchase_shipping_info.php" method="get"> 
<!--     <input name="ID" type="hidden" value="IC_client"> 
    <input name="titre" type="hidden" value="TITLE"> 
    <input name="desc" type="hidden" value="zone+1"> 
    <input name="zone" type="hidden" value="zone+2"> --> 
    <input name="prix" type="hidden" value="'.$totalcost.'.00"> 
    <input name="devise" type="hidden" value="EUR"> 
    <!-- <input name="url_redir" type="hidden" value="http://www.photo-live.com/return.php"> --> 
               
    <input name="submit" type="submit" value="'.$t['pay and get'].'" class="button"></p> 
    </form> 
    </div> 
    </td> 
    <td style="width:150"> 
    <img src="images/envelope.jpg" width="76" height="72" border="0"> 
    </td> 
    </tr></table> 
     
     
    '; 
 
 require 'footer.inc.php' ?>


la table plitems

Structure de la table `plitems`
CREATE TABLE IF NOT EXISTS `plitems` (
`idemPhotoID` int(11) NOT NULL default '0',
`idemShoppingCartID` varchar(255) NOT NULL,
PRIMARY KEY (`idemPhotoID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Contenu de la table `plitems`

la table plphotos
Structure de la table `plphotos`
CREATE TABLE IF NOT EXISTS `plphotos` (
`phID` varchar(255) NOT NULL default '',
`phAuthorID` varchar(25) NOT NULL default '',
`phStatus` varchar(255) NOT NULL default '',
`phAccessCode` varchar(255) NOT NULL,
`caID` varchar(255) NOT NULL default '',
`phFilename` varchar(255) NOT NULL default '',
`phDescription` varchar(255) NOT NULL default '',
`phCategoryID` varchar(255) NOT NULL,
`phDate` datetime NOT NULL default '0000-00-00 00:00:00',
PRIMARY KEY (`phID`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1;
Si quelqu'un peut m'aider