0

this is my code

i wanna insert value starting with cb into no table coming from form. but i cannot count $a (just starting with cb) value

foreach($_GET as $a=>$b){
		$q1 = "UPDATE no SET drm = 1,
								s = '$time',
								h	= '$dest'
							WHERE 
								s = '$b'";
		$q2	= "UPDATE no_ta SET gsayi=gsayi+$x";

								
						
		if(!mysql_query($q1) || !mysql_query($q2)){
				echo "Hata No : ".mysql_errno()."<br/> Hata Mesajı :".mysql_error();
				
			}	
	}

data coming from from like following

hedef-zodehala
button-Gonder
cb1-6319039
cb2-8151977
cb3-8151977
cb4-6914312
cb5-7749106
cb6-6622528
cb7-5707214

for example when i used count($a) result is 1111111 (seven one) in fact it must be just 7. how can i do it

4
Contributors
9
Replies
10
Views
5 Years
Discussion Span
Last Post by pzuurveen
0

I assume that this is set somewhere before the loop

Why are you using $_GET? $_POST would be more tidy. I don't think you want all that data in the url.

Show your form.

0

what count() did you use? php count or sql count? I assume you use the php count, so the reason why it displayed 1111111 is because you put the php count() inside the loop

Edited by vaultdweller123: n/a

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.