INSERT werkt niet
Ik heb een online spel gemaakt en bij het onderstaande script werkt alles...behalve het feit dat hij vanaf regel 96 niet naar de db schrijft. Ik heb het nu al 100x doorlopen en zie het gewoon echt niet.
Iemand een idee ?
Code (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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
<?
$page_url = explode(".", $_SERVER['REQUEST_URI']);
$_SERVER['REQUEST_URI'] = $page_url[0].".php";
if($_SERVER['REQUEST_URI'] == "/_gtprostitution.php"){
exit();
}
$gtprostitution_information = explode("-", $gtprostitution);
if(isset($_POST['Commit'])){
if(empty($_POST['crime'])){
echo "<font color='#ffffff'>You didn't select the way to get the prostitute to work for you.</font>";
}else{
if ($button_value == $_POST['userdigit']) {
if((time() <= $gtprostitution_information[0]) ) {
echo "<font color='#ffffff'>You can only persuade a prostitute once per 4 minutes.</font>";
}else{
if (ereg('[^A-Za-z0-9]', $_POST['target']) and $_POST['crime'] == 5) {
echo "<font color='#ffffff'>Invalid Name only A-Z,a-z and 0-9 is allowed.</font>";
}else{
if(strlen($_POST['target']) > 20 and $_POST['crime'] == 5){
echo "<font color='#ffffff'>Invalid Target.</font>";
}else{
if($_POST['crime'] == 5){
$nsql = "SELECT name FROM login WHERE name='".mysql_real_escape_string($_POST['target'])."'";
$query = mysql_query($nsql) or die(mysql_error());
$row = mysql_fetch_object($query);
$target_name = htmlspecialchars($row->name);
}
if((empty($target_name) or $name == $target_name)and $_POST['crime'] == 5){
echo "<font color='#ffffff'>This person doesn't exist.</font>";
}else{
if (in_array($target_name, $admin_array) or in_array($target_name, $manager_array)) {
echo "<font color='#ffffff'>Its not allowed to use this function on staff members, their girls ain't going nowhere.</font>";
}else{
if (rand(0,100) <= $gtprostitution_information[1]) {
if($_POST['crime'] == 5){
$sql = "SELECT id FROM whores WHERE location = '".mysql_real_escape_string($location)."' and selling!='1' and owner='".mysql_real_escape_string($_POST['target'])."'";
$res = mysql_query($sql) or die(mysql_error());
$count = mysql_num_rows($res);
$whore_array = mysql_fetch_array($res);
if($count <= 0){
echo "<font color='#ffffff'>You failed to persuade a prostitute.</font>";
}else{
$persuaded_whore = $whore_array[array_rand($whore_array, 1)];
$query = "SELECT owner,pimping FROM whores WHERE id='".mysql_real_escape_string($persuaded_whore)."'";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
$result = mysql_query("UPDATE whores SET owner='".mysql_real_escape_string($name)."' WHERE id='" .mysql_real_escape_string($persuaded_whore). "'")
or die(mysql_error());
// sending message
$result = mysql_query("UPDATE login SET newmail='0' WHERE name='" .mysql_real_escape_string($_POST['target']). "'")
or die(mysql_error());
$message = $name." persuaded one of your girls to work for him.";
$sql = "INSERT INTO pm SET id = '', sendto = '" .mysql_real_escape_string($_POST['target']). "', message = '" .mysql_real_escape_string($message). "', sendby = '" .mysql_real_escape_string($_POST['target']). "'";
$res = mysql_query($sql);
echo "<font color='#ffffff'>You persuaded a ".$whore_army[$row['pimping'] - 1]." from ".$row['owner'].".</font>";
}
}else{
srand((double)microtime()*1000000);
$random_whore = rand (1,6);
$whoreimg = array ("Spanish girl", "Italian girl", "Russian girl", "Dutch girl", "English girl", "French girl");
shuffle($whoreimg);
$random_img = $whoreimg[0];
$random_condition = rand (0,100);
$up_percentage = 100 - $random_condition; $moneyworth = $whore_new_value[$random_whore - 1] / 100; $moneyworth = round($moneyworth) * $up_percentage;
$sQuery = 'SELECT image FROM whore_image WHERE pimping= '.$random_whore.'';
$sResult = mysql_query($sQuery) or die(mysql_error());
$oRow = mysql_fetch_object($sResult);
$imgwhore = $oRow->image;
$sql = "INSERT INTO whores SET id = '', owner = '" .mysql_real_escape_string($name). "', imgwhore = '" .$imgwhore. "', pimping = '" .mysql_real_escape_string($random_whore). "',origin = '" .mysql_real_escape_string($location). "', location = '" .mysql_real_escape_string($location). "', condition = '" .mysql_real_escape_string($random_condition). "', moneyworth = '" .mysql_real_escape_string($moneyworth). "'";
$res = mysql_query($sql);
echo "<font color='#ffffff'>You persuaded a ".$whore_army[$random_whore - 1]."<br /> <center> <img src=\"http://www.elitegangsters.nl/img/whores/".$imgwhore."\"></center> </font>";
}
}else{
if(rand(0,3) == 2){
echo "<font color='#ffffff'>You failed to persuade a prostitute, when you tried by force the cops caught you.</font>";
$enter_jail = true;
}else{
echo "<font color='#ffffff'>You failed to persuade a prostitute.</font>";}
}// if failed.
$gtprostitution_information[0] = strtotime ("+4 minutes");
if($gtprostitution_information[1] <= "75" ){ $gtprostitution_information[1] = $gtprostitution_information[1] + rand(0,4); }else{ $gtprostitution_information[1] = "75"; }
if( $gtprostitution_information[1] > "75"){ $gtprostitution_information[1] = "75"; }
$arrayrates = array($gtprostitution_information[0], $gtprostitution_information[1]);
$newrates = implode("-", $arrayrates);
if($enter_jail == true){
$new_exp = $exp + rand(3,6);
$result = mysql_query("UPDATE login SET exp='".mysql_real_escape_string($new_exp)."',gtprostitution='".mysql_real_escape_string($newrates)."',jail='".strtotime ("+1 minute")."-1' WHERE id='" .mysql_real_escape_string($_SESSION['user_id']). "'")
or die(mysql_error());
}else{
$new_exp = $exp + rand(3,6);
$result = mysql_query("UPDATE login SET exp='".mysql_real_escape_string($new_exp)."',gtprostitution='".mysql_real_escape_string($newrates)."' WHERE id='" .mysql_real_escape_string($_SESSION['user_id']). "'")
or die(mysql_error());
}// if jail.
}// gtprostitution time check.
}// name check.
}// if staff.
}}// invalid name check.
} else {
echo "<font color='#ffffff'>The verification code did not match.</font>";
}// else wrong activation code.
}// if no crime selected.
}// if isset persuade a prostitute
// if isset.
if(isset($_POST['action'])){
$query = "SELECT * FROM whores WHERE id='".mysql_real_escape_string($_POST['whore'])."'";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
if(empty($_POST['whore'])){
echo "<font color='#ffffff'>You didn't select a prostitute.</font>";
}else{
if($row['owner'] != $name){
echo "<font color='#ffffff'>This isn't one of your girls.</font>";
}else{
if($location != $row['location']){
echo "<font color='#ffffff'>You need to be in the same location as the prostitute is.</font>";
}else{
if($row['selling'] == "1"){
echo "<font color='#ffffff'>You can't put out a girl on the streets when she is already earning you money.</font>";
}else{
// repair.
if($_POST['action'] == "Beauty treatment."){
$costs = $whore_new_value[$row['pimping'] - 1] - $row['moneyworth'];
if($costs > $money){
echo "<font color='#ffffff'>You don't have enough money to send your girl to a beauty spa.</font>";
}else{
if($row['condition'] == 0 ){
echo "<font color='#ffffff'>Your girl is in perfect health.</font>";
}else{
$result = mysql_query("UPDATE whores SET condition='0', value='".mysql_real_escape_string($whore_new_value[$row['pimping'] - 1])."' WHERE id='" .mysql_real_escape_string($_POST['whore']). "'")
or die(mysql_error());
$result = mysql_query("UPDATE login SET money=money-'".mysql_real_escape_string($costs)."' WHERE id='" .mysql_real_escape_string($_SESSION['user_id']). "'")
or die(mysql_error());
$money = $money - $costs;
echo "<font color='#ffffff'>You sent your prostitute, a </font>".$whore_army[$row['pimping'] - 1];", <font color='#ffffff'>to a beauty spa so she will look better for your customers.</font>";
}// zero condition check.
}// money check.
}// if beauty spa.
// Dispose girl.
if($_POST['action'] == "Fire girl."){
$dres = mysql_query("DELETE FROM whores WHERE id='" .mysql_real_escape_string($_POST['whore']). "'")
or die(mysql_error());
echo "<font color='#ffffff'>You disposed yourself of the </font>".$whore_army[$row['pimping'] - 1];". <font color='#ffffff'>She should have made you more money.</font>";
}
// transport girl.
if($_POST['action'] == "Fly her over."){
$result = mysql_query("UPDATE whores SET location='".mysql_real_escape_string($_POST['location'])."' WHERE id='" .mysql_real_escape_string($_POST['whore']). "'")
or die(mysql_error());
echo "<font color='#ffffff'>You put your ".$whore_army[$row['pimping'] - 1]." on a plane to ".$location_array[$_POST['location']]."</font>";
}// if transport.
// Sell car.
if($_POST['action'] == "Sell to another pimp."){
if($row['pimping'] >=7){
echo "<font color='#ffffff'>This girl doesn't exist.</font>";
}else{
$dres = mysql_query("DELETE FROM whores WHERE id='" .mysql_real_escape_string($_POST['whore']). "'")
or die(mysql_error());
echo "<font color='#ffffff'>You sold your ".$whore_army[$row['pimping'] - 1]." for $ ".$row['moneyworth'].",-</font>";
$money = $money + $row['moneyworth'];
$result = mysql_query("UPDATE login SET money='".mysql_real_escape_string($money)."' WHERE id='" .mysql_real_escape_string($_SESSION['user_id']). "'")
or die(mysql_error());
}// whore check.
}
}// red light district check.
}// same location check.
}// no girl check.
}// owner check.
}// if isset action.
?>
$page_url = explode(".", $_SERVER['REQUEST_URI']);
$_SERVER['REQUEST_URI'] = $page_url[0].".php";
if($_SERVER['REQUEST_URI'] == "/_gtprostitution.php"){
exit();
}
$gtprostitution_information = explode("-", $gtprostitution);
if(isset($_POST['Commit'])){
if(empty($_POST['crime'])){
echo "<font color='#ffffff'>You didn't select the way to get the prostitute to work for you.</font>";
}else{
if ($button_value == $_POST['userdigit']) {
if((time() <= $gtprostitution_information[0]) ) {
echo "<font color='#ffffff'>You can only persuade a prostitute once per 4 minutes.</font>";
}else{
if (ereg('[^A-Za-z0-9]', $_POST['target']) and $_POST['crime'] == 5) {
echo "<font color='#ffffff'>Invalid Name only A-Z,a-z and 0-9 is allowed.</font>";
}else{
if(strlen($_POST['target']) > 20 and $_POST['crime'] == 5){
echo "<font color='#ffffff'>Invalid Target.</font>";
}else{
if($_POST['crime'] == 5){
$nsql = "SELECT name FROM login WHERE name='".mysql_real_escape_string($_POST['target'])."'";
$query = mysql_query($nsql) or die(mysql_error());
$row = mysql_fetch_object($query);
$target_name = htmlspecialchars($row->name);
}
if((empty($target_name) or $name == $target_name)and $_POST['crime'] == 5){
echo "<font color='#ffffff'>This person doesn't exist.</font>";
}else{
if (in_array($target_name, $admin_array) or in_array($target_name, $manager_array)) {
echo "<font color='#ffffff'>Its not allowed to use this function on staff members, their girls ain't going nowhere.</font>";
}else{
if (rand(0,100) <= $gtprostitution_information[1]) {
if($_POST['crime'] == 5){
$sql = "SELECT id FROM whores WHERE location = '".mysql_real_escape_string($location)."' and selling!='1' and owner='".mysql_real_escape_string($_POST['target'])."'";
$res = mysql_query($sql) or die(mysql_error());
$count = mysql_num_rows($res);
$whore_array = mysql_fetch_array($res);
if($count <= 0){
echo "<font color='#ffffff'>You failed to persuade a prostitute.</font>";
}else{
$persuaded_whore = $whore_array[array_rand($whore_array, 1)];
$query = "SELECT owner,pimping FROM whores WHERE id='".mysql_real_escape_string($persuaded_whore)."'";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
$result = mysql_query("UPDATE whores SET owner='".mysql_real_escape_string($name)."' WHERE id='" .mysql_real_escape_string($persuaded_whore). "'")
or die(mysql_error());
// sending message
$result = mysql_query("UPDATE login SET newmail='0' WHERE name='" .mysql_real_escape_string($_POST['target']). "'")
or die(mysql_error());
$message = $name." persuaded one of your girls to work for him.";
$sql = "INSERT INTO pm SET id = '', sendto = '" .mysql_real_escape_string($_POST['target']). "', message = '" .mysql_real_escape_string($message). "', sendby = '" .mysql_real_escape_string($_POST['target']). "'";
$res = mysql_query($sql);
echo "<font color='#ffffff'>You persuaded a ".$whore_army[$row['pimping'] - 1]." from ".$row['owner'].".</font>";
}
}else{
srand((double)microtime()*1000000);
$random_whore = rand (1,6);
$whoreimg = array ("Spanish girl", "Italian girl", "Russian girl", "Dutch girl", "English girl", "French girl");
shuffle($whoreimg);
$random_img = $whoreimg[0];
$random_condition = rand (0,100);
$up_percentage = 100 - $random_condition; $moneyworth = $whore_new_value[$random_whore - 1] / 100; $moneyworth = round($moneyworth) * $up_percentage;
$sQuery = 'SELECT image FROM whore_image WHERE pimping= '.$random_whore.'';
$sResult = mysql_query($sQuery) or die(mysql_error());
$oRow = mysql_fetch_object($sResult);
$imgwhore = $oRow->image;
$sql = "INSERT INTO whores SET id = '', owner = '" .mysql_real_escape_string($name). "', imgwhore = '" .$imgwhore. "', pimping = '" .mysql_real_escape_string($random_whore). "',origin = '" .mysql_real_escape_string($location). "', location = '" .mysql_real_escape_string($location). "', condition = '" .mysql_real_escape_string($random_condition). "', moneyworth = '" .mysql_real_escape_string($moneyworth). "'";
$res = mysql_query($sql);
echo "<font color='#ffffff'>You persuaded a ".$whore_army[$random_whore - 1]."<br /> <center> <img src=\"http://www.elitegangsters.nl/img/whores/".$imgwhore."\"></center> </font>";
}
}else{
if(rand(0,3) == 2){
echo "<font color='#ffffff'>You failed to persuade a prostitute, when you tried by force the cops caught you.</font>";
$enter_jail = true;
}else{
echo "<font color='#ffffff'>You failed to persuade a prostitute.</font>";}
}// if failed.
$gtprostitution_information[0] = strtotime ("+4 minutes");
if($gtprostitution_information[1] <= "75" ){ $gtprostitution_information[1] = $gtprostitution_information[1] + rand(0,4); }else{ $gtprostitution_information[1] = "75"; }
if( $gtprostitution_information[1] > "75"){ $gtprostitution_information[1] = "75"; }
$arrayrates = array($gtprostitution_information[0], $gtprostitution_information[1]);
$newrates = implode("-", $arrayrates);
if($enter_jail == true){
$new_exp = $exp + rand(3,6);
$result = mysql_query("UPDATE login SET exp='".mysql_real_escape_string($new_exp)."',gtprostitution='".mysql_real_escape_string($newrates)."',jail='".strtotime ("+1 minute")."-1' WHERE id='" .mysql_real_escape_string($_SESSION['user_id']). "'")
or die(mysql_error());
}else{
$new_exp = $exp + rand(3,6);
$result = mysql_query("UPDATE login SET exp='".mysql_real_escape_string($new_exp)."',gtprostitution='".mysql_real_escape_string($newrates)."' WHERE id='" .mysql_real_escape_string($_SESSION['user_id']). "'")
or die(mysql_error());
}// if jail.
}// gtprostitution time check.
}// name check.
}// if staff.
}}// invalid name check.
} else {
echo "<font color='#ffffff'>The verification code did not match.</font>";
}// else wrong activation code.
}// if no crime selected.
}// if isset persuade a prostitute
// if isset.
if(isset($_POST['action'])){
$query = "SELECT * FROM whores WHERE id='".mysql_real_escape_string($_POST['whore'])."'";
$result = mysql_query($query) or die(mysql_error());
$row = mysql_fetch_array($result);
if(empty($_POST['whore'])){
echo "<font color='#ffffff'>You didn't select a prostitute.</font>";
}else{
if($row['owner'] != $name){
echo "<font color='#ffffff'>This isn't one of your girls.</font>";
}else{
if($location != $row['location']){
echo "<font color='#ffffff'>You need to be in the same location as the prostitute is.</font>";
}else{
if($row['selling'] == "1"){
echo "<font color='#ffffff'>You can't put out a girl on the streets when she is already earning you money.</font>";
}else{
// repair.
if($_POST['action'] == "Beauty treatment."){
$costs = $whore_new_value[$row['pimping'] - 1] - $row['moneyworth'];
if($costs > $money){
echo "<font color='#ffffff'>You don't have enough money to send your girl to a beauty spa.</font>";
}else{
if($row['condition'] == 0 ){
echo "<font color='#ffffff'>Your girl is in perfect health.</font>";
}else{
$result = mysql_query("UPDATE whores SET condition='0', value='".mysql_real_escape_string($whore_new_value[$row['pimping'] - 1])."' WHERE id='" .mysql_real_escape_string($_POST['whore']). "'")
or die(mysql_error());
$result = mysql_query("UPDATE login SET money=money-'".mysql_real_escape_string($costs)."' WHERE id='" .mysql_real_escape_string($_SESSION['user_id']). "'")
or die(mysql_error());
$money = $money - $costs;
echo "<font color='#ffffff'>You sent your prostitute, a </font>".$whore_army[$row['pimping'] - 1];", <font color='#ffffff'>to a beauty spa so she will look better for your customers.</font>";
}// zero condition check.
}// money check.
}// if beauty spa.
// Dispose girl.
if($_POST['action'] == "Fire girl."){
$dres = mysql_query("DELETE FROM whores WHERE id='" .mysql_real_escape_string($_POST['whore']). "'")
or die(mysql_error());
echo "<font color='#ffffff'>You disposed yourself of the </font>".$whore_army[$row['pimping'] - 1];". <font color='#ffffff'>She should have made you more money.</font>";
}
// transport girl.
if($_POST['action'] == "Fly her over."){
$result = mysql_query("UPDATE whores SET location='".mysql_real_escape_string($_POST['location'])."' WHERE id='" .mysql_real_escape_string($_POST['whore']). "'")
or die(mysql_error());
echo "<font color='#ffffff'>You put your ".$whore_army[$row['pimping'] - 1]." on a plane to ".$location_array[$_POST['location']]."</font>";
}// if transport.
// Sell car.
if($_POST['action'] == "Sell to another pimp."){
if($row['pimping'] >=7){
echo "<font color='#ffffff'>This girl doesn't exist.</font>";
}else{
$dres = mysql_query("DELETE FROM whores WHERE id='" .mysql_real_escape_string($_POST['whore']). "'")
or die(mysql_error());
echo "<font color='#ffffff'>You sold your ".$whore_army[$row['pimping'] - 1]." for $ ".$row['moneyworth'].",-</font>";
$money = $money + $row['moneyworth'];
$result = mysql_query("UPDATE login SET money='".mysql_real_escape_string($money)."' WHERE id='" .mysql_real_escape_string($_SESSION['user_id']). "'")
or die(mysql_error());
}// whore check.
}
}// red light district check.
}// same location check.
}// no girl check.
}// owner check.
}// if isset action.
?>
Gewijzigd op 01/01/1970 01:00:00 door Dennis
Dennis schreef op 10.07.2008 20:35:
vanaf regel 96 niet naar de db schrijft
Waarom dan zo'n ellenlang script posten? Post relevante code, meer niet.
Code (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
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
<?php
$sql = "
INSERT INTO whores (
id,
owner,
imgwhore,
pimping,
origin,
location,
conditionmoneyworth
)
VALUES(
'',
'" .mysql_real_escape_string($name). "',
'" .$imgwhore. "',
'" .mysql_real_escape_string($random_whore). "',
'" .mysql_real_escape_string($location). "',
'" .mysql_real_escape_string($location). "',
'" .mysql_real_escape_string($random_condition). "',
'" .mysql_real_escape_string($moneyworth). "')";
$res = mysql_query($sql);
if(mysql_affected_rows() ==0){
?>
er is niets geinsert, de volgende query werd uitgevoerd <pre> <?php echo $sql; ?> </pre>
<?php }
else{
?>
er is wat gebeurt bij het uitvoeren van de volgende querry </pre><?php echo $sql; ?></pre>
<?php } ?>
?>
$sql = "
INSERT INTO whores (
id,
owner,
imgwhore,
pimping,
origin,
location,
conditionmoneyworth
)
VALUES(
'',
'" .mysql_real_escape_string($name). "',
'" .$imgwhore. "',
'" .mysql_real_escape_string($random_whore). "',
'" .mysql_real_escape_string($location). "',
'" .mysql_real_escape_string($location). "',
'" .mysql_real_escape_string($random_condition). "',
'" .mysql_real_escape_string($moneyworth). "')";
$res = mysql_query($sql);
if(mysql_affected_rows() ==0){
?>
er is niets geinsert, de volgende query werd uitgevoerd <pre> <?php echo $sql; ?> </pre>
<?php }
else{
?>
er is wat gebeurt bij het uitvoeren van de volgende querry </pre><?php echo $sql; ?></pre>
<?php } ?>
?>
Probeer dit eens
Gewijzigd op 01/01/1970 01:00:00 door Klaasjan Boven
Klaasjan Boven schreef op 10.07.2008 20:51:
Code (php)
1
2
3
4
5
6
7
8
9
10
11
2
3
4
5
6
7
8
9
10
11
<?php
if(mysql_affected_rows() <>0){
?>
er is niets geinsert
<?php }
else{
?>
er is wat gebeurt
<?php } ?>
?>
if(mysql_affected_rows() <>0){
?>
er is niets geinsert
<?php }
else{
?>
er is wat gebeurt
<?php } ?>
?>
Moet dat niet andersom? ( == 0 )
Gewijzigd op 01/01/1970 01:00:00 door - SanThe -
Bedankt San !
@ Klaasjan
schrijft ook niet naar db :(
begrijp er echt helemaal niets van...heb een kopie vh script voor het stelen van auto's en dat werkt perfect....alleen nu dus niet..
Gewijzigd op 01/01/1970 01:00:00 door Dennis
Notice: Undefined variable: disabled in /mnt/web6/20/57/51672857/htdocs/eg/gtprostitution.php on line 56
/>
ik heb dit gechecked met de andere pagina waarvan ik een kopie vh script grotendeels van heb en het komt wel overeen met elkaar.
Gewijzigd op 01/01/1970 01:00:00 door Dennis
Dennis schreef op 10.07.2008 21:26:
Notice: Undefined variable: disabled
Die bestaat dus niet.
Punt is als ik die "weg" haal, dan checked die niet meer voor optie 5 waarbij men een naam kan invullen van de admins of de moderators ( is niet toegestaan ). Ik heb exact hetzelfde gij grand theft auto in het spel en daar werkt het perfect...
SanThe schreef op 10.07.2008 21:34:
Die bestaat dus niet.
Dennis schreef op 10.07.2008 21:26:
Notice: Undefined variable: disabled
Die bestaat dus niet.
Deze notice heeft niets met bovenstaand script te maken. Daar staat ie namelijk niet in.
Maar je weet nu wel welke query uitgevoerd werd.Kopieer die eens en laat die hier eens zien.
(regel 50 )
Code (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
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
<form method="post">
<?php
if($rank >= "2"){
if(time() <= $gtprostitution_information[0]){
if(!$_POST['Commit']){
echo "<font color='#ffffff'>You need to lay low for a little while.<br /></font>".date( "00:i:s", $gtprostitution_information[0] - time() );
}
}else{
?>
<table width="295" border="0" align="center" cellpadding="0" cellspacing="2" class="table">
<tr>
<td colspan="3" align="center" class="head">Persuade a prostitute: <br />
<img src="afbeeldingen/gtprostitution.jpg" width="450" height="308" /></td>
</tr>
<tr>
<td colspan="3" align="center" class="cell">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="25" align="left"><input name="crime" type="radio" value="1" id="1" onfocus="if(this.blur)this.blur()"/></td>
<td><label for="1" ><font color='#ffffff'>Give her some jewelry.</font></label></td>
<td width="35"> </td>
</tr>
<tr>
<td width="25" align="left"><input name="crime" type="radio" value="2" id="2" onfocus="if(this.blur)this.blur()"/></td>
<td><label for="2" ><font color='#ffffff'>Threaten her family.</font></label></td>
<td width="35"> </td>
</tr>
<tr>
<td width="25" align="left"><input name="crime" type="radio" value="3" id="3" onfocus="if(this.blur)this.blur()"/></td>
<td><label for="3" ><font color='#ffffff'>Hold a gun to her head.</font></label></td>
<td width="35"> </td>
</tr>
<tr>
<td width="25" align="left"><input name="crime" type="radio" value="4" id="4" onfocus="if(this.blur)this.blur()"/></td>
<td><label for="4" ><font color='#ffffff'>Beat her up bad.</font></label></td>
<td width="35"> </td>
</tr>
<tr>
<td width="25" align="left"><input name="crime" type="radio" value="5" id="5" onfocus="if(this.blur)this.blur()"/></td>
<td><input name="target" type="text" class="entryfield" id="target" onfocus="if(this.value=='Persuade a prostitute from another pimp.')this.value='';" value="Persuade a prostitute from another pimp." /></td>
<td width="35"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="120" align="center" class="submit"><img src="button.php" alt="Verification." width="120" height="30" /></td>
<td width="100" align="center" class="submit"><input name="userdigit" type="text" class="entryfield" style='width: 85%; ' size="5" maxlength="5"<?php echo $disabled; ?>/></td>
<td width="120" align="center" class="submit"><input name="Commit" type="submit" class="button" value="Commit." onFocus="if(this.blur)this.blur()"/></td>
</tr>
</table>
<br />
<?php }} ?>
<?php
if($rank >= "2"){
if(time() <= $gtprostitution_information[0]){
if(!$_POST['Commit']){
echo "<font color='#ffffff'>You need to lay low for a little while.<br /></font>".date( "00:i:s", $gtprostitution_information[0] - time() );
}
}else{
?>
<table width="295" border="0" align="center" cellpadding="0" cellspacing="2" class="table">
<tr>
<td colspan="3" align="center" class="head">Persuade a prostitute: <br />
<img src="afbeeldingen/gtprostitution.jpg" width="450" height="308" /></td>
</tr>
<tr>
<td colspan="3" align="center" class="cell">
<table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="25" align="left"><input name="crime" type="radio" value="1" id="1" onfocus="if(this.blur)this.blur()"/></td>
<td><label for="1" ><font color='#ffffff'>Give her some jewelry.</font></label></td>
<td width="35"> </td>
</tr>
<tr>
<td width="25" align="left"><input name="crime" type="radio" value="2" id="2" onfocus="if(this.blur)this.blur()"/></td>
<td><label for="2" ><font color='#ffffff'>Threaten her family.</font></label></td>
<td width="35"> </td>
</tr>
<tr>
<td width="25" align="left"><input name="crime" type="radio" value="3" id="3" onfocus="if(this.blur)this.blur()"/></td>
<td><label for="3" ><font color='#ffffff'>Hold a gun to her head.</font></label></td>
<td width="35"> </td>
</tr>
<tr>
<td width="25" align="left"><input name="crime" type="radio" value="4" id="4" onfocus="if(this.blur)this.blur()"/></td>
<td><label for="4" ><font color='#ffffff'>Beat her up bad.</font></label></td>
<td width="35"> </td>
</tr>
<tr>
<td width="25" align="left"><input name="crime" type="radio" value="5" id="5" onfocus="if(this.blur)this.blur()"/></td>
<td><input name="target" type="text" class="entryfield" id="target" onfocus="if(this.value=='Persuade a prostitute from another pimp.')this.value='';" value="Persuade a prostitute from another pimp." /></td>
<td width="35"> </td>
</tr>
</table></td>
</tr>
<tr>
<td width="120" align="center" class="submit"><img src="button.php" alt="Verification." width="120" height="30" /></td>
<td width="100" align="center" class="submit"><input name="userdigit" type="text" class="entryfield" style='width: 85%; ' size="5" maxlength="5"<?php echo $disabled; ?>/></td>
<td width="120" align="center" class="submit"><input name="Commit" type="submit" class="button" value="Commit." onFocus="if(this.blur)this.blur()"/></td>
</tr>
</table>
<br />
<?php }} ?>
Gewijzigd op 01/01/1970 01:00:00 door Dennis
Code (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
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
<?php
$sQuery = 'SELECT image FROM whore_image WHERE pimping= '.$random_whore.'';
$sResult = mysql_query($sQuery) or die(mysql_error());
$oRow = mysql_fetch_object($sResult);
$imgwhore = $oRow->image;
$insert_whore = "
INSERT INTO whores (
id,
owner,
imgwhore,
pimping,
origin,
location,
condition,
moneyworth
)
VALUES (
'',
'".mysql_real_escape_string($name)."',
'".$imgwhore."',
'".mysql_real_escape_string($random_whore)."',
'".mysql_real_escape_string($location)."',
'".mysql_real_escape_string($location)."',
'".mysql_real_escape_string($random_condition)."',
'".mysql_real_escape_string($moneyworth)."'
)
";
if(!$res = mysql_query($insert_whore))
{
echo '<pre>';
echo mysql_error();
echo '</pre>';
}
echo "<font color='#ffffff'>You persuaded a ".$whore_army[$random_whore - 1]."<br /> <center> <img src=\"http://www.elitegangsters.nl/img/whores/".$imgwhore."\"></center> </font>";
?>
$sQuery = 'SELECT image FROM whore_image WHERE pimping= '.$random_whore.'';
$sResult = mysql_query($sQuery) or die(mysql_error());
$oRow = mysql_fetch_object($sResult);
$imgwhore = $oRow->image;
$insert_whore = "
INSERT INTO whores (
id,
owner,
imgwhore,
pimping,
origin,
location,
condition,
moneyworth
)
VALUES (
'',
'".mysql_real_escape_string($name)."',
'".$imgwhore."',
'".mysql_real_escape_string($random_whore)."',
'".mysql_real_escape_string($location)."',
'".mysql_real_escape_string($location)."',
'".mysql_real_escape_string($random_condition)."',
'".mysql_real_escape_string($moneyworth)."'
)
";
if(!$res = mysql_query($insert_whore))
{
echo '<pre>';
echo mysql_error();
echo '</pre>';
}
echo "<font color='#ffffff'>You persuaded a ".$whore_army[$random_whore - 1]."<br /> <center> <img src=\"http://www.elitegangsters.nl/img/whores/".$imgwhore."\"></center> </font>";
?>
Nu krijg ik de melding :
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 'condition,
moneyworth
)
VALUES (
'',
'S' at line 8
Zie alleen niet wat ik hier nu fout gedaan heb ondanks de melding.
Gewijzigd op 01/01/1970 01:00:00 door Dennis
Je mag 'condition' niet gebruiken als veldnaam. Het is een 'reserved word' van mysql.