Hello,
Ik heb ondertussen het een en ander geraadpleegd. En ik ben dus tot hier geraakt. Nu krijg ik enkel nog de mededeling dat
"Warning: sprintf(): Too few arguments in /var/www/vhosts/backup/reseler16/fedhoreca.oakfield.be/htdocs/new_site/admin/add_user2.php on line 39
Query was empty"
heeft er misschien iemand een ideetje wat er nog mis loopt?
alvast bedankt
Ik heb ondertussen het een en ander geraadpleegd. En ik ben dus tot hier geraakt. Nu krijg ik enkel nog de mededeling dat
"Warning: sprintf(): Too few arguments in /var/www/vhosts/backup/reseler16/fedhoreca.oakfield.be/htdocs/new_site/admin/add_user2.php on line 39
Query was empty"
heeft er misschien iemand een ideetje wat er nog mis loopt?
alvast bedankt
PHP:
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
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
| [php=4] <?php require_once('../Connections/connexion.php'); ?> <?php function GetSQLValueString($theValue, $theType, $theDefinedValue = "", $theNotDefinedValue = "") { $theValue = (!get_magic_quotes_gpc()) ? addslashes($theValue) : $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; } $editFormAction = $HTTP_SERVER_VARS['PHP_SELF']; if (isset($HTTP_SERVER_VARS['QUERY_STRING'])) { $editFormAction .= "?" . $HTTP_SERVER_VARS['QUERY_STRING']; } if ((isset($HTTP_POST_VARS["MM_insert"])) && ($HTTP_POST_VARS["MM_insert"] == "form1")) { $insertSQL = sprintf("INSERT INTO tb_user (nom, login, pwd, email, acces) VALUES (%s, %s, %s, %s, %s, %s, %s)", GetSQLValueString($HTTP_POST_VARS['nom'], "text"), GetSQLValueString($HTTP_POST_VARS['login'], "text"), GetSQLValueString($HTTP_POST_VARS['pwd'], "text"), GetSQLValueString($HTTP_POST_VARS['email'], "text"), GetSQLValueString($HTTP_POST_VARS['acces'], "int")); mysql_select_db($database_connexion, $connexion); $Result1 = mysql_query($insertSQL, $connexion) or die(mysql_error()); /* header(sprintf("Location: %s", $editFormAction)); */ } ?> <?php mysql_select_db($database_connexion, $connexion); $query_q_user_all = "SELECT * FROM tb_user ORDER BY nom ASC"; $q_user_all = mysql_query($query_q_user_all, $connexion) or die(mysql_error()); //$row_q_user_all = mysql_fetch_assoc($q_user_all); $totalRows_q_user_all = mysql_num_rows($q_user_all); define('SELF',$_SERVER['PHP_SELF']); $content_line = ''; while ($row_q_user_all = mysql_fetch_assoc($q_user_all)){ $content_line .='<form name="form'.$row_q_user_all['id_user'].'" method="post" action="'.SELF.'">'; $content_line .='<tr><td><input name="id_user" type="hidden" value="'.$row_q_user_all['id_user'].'">'; $content_line .='<input type="text" name="nom" value="'.$row_q_user_all['nom'].'"></td>'; $content_line .='<td><input type="text" name="login" value="'.$row_q_user_all['login'].'"></td>'; $content_line .='<td><input type="password" name="pwd" value="'.$row_q_user_all['pwd'].'"></td>'; $content_line .='<td><input type="text" name="email" value="'.$row_q_user_all['email'].'"></td>'; $content_line .='a'; $content_line .='<td><select name="acces"> <option value="all" '.$row_q_user_all['acces']=='all'?'selected':''.'>All</option> <option value="cafe"'.$row_q_user_all['acces']=='cafe'?'selected':''.'>Café</option> <option value="hotel"'.$row_q_user_all['acces']=='hotel'?'selected':''.'>Hôtels</option> <option value="resto"'.$row_q_user_all['acces']=='resto'?'selected':''.'>Restaurants</option> </select></td>'; $content_line .='<td><input name="mod" type="submit" id="submit" value="Modifier"></td>'; $content_line .='<td><input type="Submit" name="sup" id="submit" value="Supprimer"></td></tr></form>'; }; ?> <?php echo $_POST['id_user']; ?> <table width="100%" border="0" cellspacing="0" cellpadding="0"> <tr> <td>nom</td> <td>login</td> <td>mot de passe </td> <td>email</td> <td>acces</td> <td>modifier</td> <td>supprimer</td> </tr> <?php echo $content_line; ?> <tr> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> <td> </td> </tr> <form name="form1" method="post" action="<?php echo $editFormAction ?>"> <tr> <td><input name="MM_insert" type="hidden" value="form1"> <input type="text" name="nom"></td> <td><input type="text" name="login"></td> <td><input type="text" name="pwd"></td> <td><input type="text" name="email"></td> <td><select name="acces"> <option value="5">5</option> <option value="4">4</option> <option value="3">3</option> <option value="2">2</option> </select></td> <td><input type="submit" name="Submit" value="Ajouter"> </td> <td> </td> </tr> </form> </table> <?php mysql_free_result($q_user_all); echo "$q_user_all"; ?> [/php] |
[ Voor 28% gewijzigd door Verwijderd op 21-09-2005 16:48 ]