RE: [PHP] Validation problem with array.

From: Date: Thu, 21 Oct 2004 12:06:17 +0000
Subject: RE: [PHP] Validation problem with array.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-199969@lists.php.net to get a copy of this message
See inline: --- Graham Cossey <graham@cossey.plus.com> wrote: > > In other words I need to figure out how to check > > that each "line" is complete. right now, it is > > matching all the values/inputs correctly. If > > someone just chose a slus, seems the database > But is this due to the sql statement being rejected > as opposed to being > caught by your validation? What validation :) . I haven't added that in yet,due to figuring out why the insertions weren't taking. > > > { > > > // You may also want to check for sky & > > > slu entries > > > You would want to because of the paragraph above > > > about "My main concern..." Right now I have this [right below]: If I want to check for skys and slus, I add another set of braces with if($sky != '' ... and below "end if ($sky != '')........ > foreach($skills as $key => $skill) { if ($skill != '' && $skys[$key] != '' && $slus[$key] != '') { $query = "INSERT INTO LurkProfiles_Skicerts (SkicertID, ProfileID, SkilCerts, NumYear, Lused) VALUES (null, $LID, '$skill', $skys[$key],$slus[$key])"; $res6 = run_query($query); echo "Query $key = $query <br>"; } end if ($skill != '') } Stuart

« previous php.general (#199969) next »