AustNet AustNet Archive Project — IRC Logs
« All channels | Contribute a log »

// #php — 2008-03-21

1996 1997 1998 1999 2000 2001 2002 2003 2004 2005 2006 2007 2008 2009 2010 2011 2012 2013 2014 2015 2016
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
03:38:22 Quit: smythe ([email protected]) Exit:
03:54:59 Quit: surman ([email protected]) Ping timeout for surman
07:18:29 Join: surman ([email protected]) to #php
11:39:03 <damian> Gel
11:49:56 Quit: optimus ([email protected]) Read error to optimus: Connection reset by peer
14:08:02 Join: N3tar3a ([email protected]) to #php
14:53:16 Join: I[S2]2chat` ([email protected]) to #php
16:05:16 Quit: schnoodles ([email protected]) Read error to schnoodles: Connection reset by peer
16:05:37 Join: schnoodles ([email protected]) to #php
16:14:06 Quit: paveway ([email protected]) Exit:
16:23:21 Join: paveway ([email protected]) to #php
17:05:51 Quit: paveway ([email protected]) Exit:
17:11:12 Join: paveway ([email protected]) to #php
17:42:56 Quit: keenly ([email protected]) Ping timeout for keenly
18:22:59 Join: optimus ([email protected]) to #PHP
19:32:19 Join: AusVote[DOT]COM ([email protected]) to #php
19:35:43 <robert_> AusVote[DOT]COM, ask in here.
19:42:28 <AusVote[DOT]COM> what i am trying to find out is, how can i set up the script to check the database if the field exists? the field i want to check would be $var2 ? databse name is graph and table is table1
19:43:09 <robert_> You fail.
19:43:18 <AusVote[DOT]COM> ?
19:47:29 <AusVote[DOT]COM> ??
20:01:51 <teq> what
20:02:22 <teq> if ($row[$var2]) { it exists! }
20:02:27 <teq> else { it doesnt! }
20:10:24 <AusVote[DOT]COM> thsanks for replying
20:10:48 <AusVote[DOT]COM> it isnot working though
20:10:59 <AusVote[DOT]COM> if ($row[$case]) { echo "exists"; }
20:11:18 <robert_> $var2 isnt a field
20:11:38 <robert_> $var2 is a php variable that evaluates to a string/integer/whatever
20:12:02 <robert_> AusVote[DOT]COM.asshat++;
20:12:33 <AusVote[DOT]COM> ok
20:12:38 <AusVote[DOT]COM> so could you help me resolve it ??
20:14:19 <robert_> depends
20:14:26 <robert_> what is $case ?
20:14:38 <robert_> what row from the database are you trying to pull?
20:14:53 <robert_> Also: is it based on user input?
20:15:35 <AusVote[DOT]COM> yes, based off user input via a form, $case is from the web form
20:15:48 <AusVote[DOT]COM> row is under column case
20:18:07 <teq> awesome
20:18:12 <teq> so what happens when someone types in
20:18:19 <teq> (in this field)
20:18:30 Part: N3tar3a ([email protected]) from #php
20:18:46 <teq> Blah';drop database website;
20:18:56 Part: I[S2]2chat` ([email protected]) from #php
20:19:07 <AusVote[DOT]COM> yes that is correct
20:19:08 <teq> and drops your entire database
20:19:15 <AusVote[DOT]COM> uhmm right
20:19:16 <teq> you need to sanatize the input
20:27:57 <robert_> thats bad
20:28:00 <robert_> bad bad BAD
20:28:01 <robert_> yes
20:28:38 <robert_> I could drop your database
20:28:48 <robert_> or give myself administrative access to your site
20:31:34 Join: hotgirl64 ([email protected]) to #php
21:11:26 Join: cypher ([email protected]) to #php
23:22:41 Join: keenly ([email protected]) to #PHP