IRC Networks
Irc Logs Stats
Start date: 2007-09-27 02:48:27
Last update: 2008-10-24 20:19:38
Channels: 41
Logged Lines: 6230436
Size: 1982.48 MB
Powered by
Channel Info
Network: freenodeChannel: #php |
Search in www.irclog.org
Log from #php at freenode 2006-06-17
Pages: < Prev
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
Next >
[07:55]<dysxnxu>Does anybody know why the authors of TUTOS might have been doing this type of operation? function obj_read(&$obj) { if ( $obj == -1 ) return;
[07:56]<dysxnxu>I am having a hard time understanding why an object would be -1 instead of just that - an object that either exists or doesn't.
[07:57]<vzyvjg>they didn't want it to be true or false?
[07:57]<vzyvjg>heavy stuff
[07:58]<dysxnxu>I have no idea.
[07:59]<m012jd_>Hello, mere mortals.
[07:59]<vzyvjg>fuk you
[07:59]<m012jd_>is anyone familiar with simple machines forum? I was wondering if I could use it's database as my websites username/pass system
[08:00]<wjppyn6au>d03, if it has an ODBC interface, and you know the schema, in theory yes
[08:01]<aljas>mere mortals? - thannk you(?)
[08:02]<m012jd_>hmm
[08:03]<vxggygvxcuv>Can I just set an array like this right? $actor = $actor[1]['red']['Hello']
[08:05]<cxzysc1t>how can I check if a field is null?
[08:05]<cxzysc1t>if (is_null(row['bla ?
[08:05]<wjppyn6au>Chris, use is_null?
[08:06]<wjppyn6au>Careful using is_null to test SQLresults, see manual entry for more detail
[08:07]<aljas>or if (string == ""){ } - should result in the same, right?
[08:07]<wjppyn6au>Apocs, use 3='s to be very sure, but yes
[08:07]<aljas>thought so
[08:08]<aljas>but even, was'nmt that sure
[08:08]<wjppyn6au>is_null "reads" better IMHO
[08:08]<aljas>sry was'nt
[08:09]<aljas>reads better, from the database?
[08:09]<ryl>Hi. Could someone tell me which method is more effective when connecting to a database?
[08:09]<ryl>Link: --> http://pastebin.com/714343
[08:09]<azxxx|bnnz>http://digg.com/design/Top_10_Web_Dev_Libraries
[08:11]<wjppyn6au>Rip, both have merit, meth2 is tighter, but depends onif you want it to die
[08:11]<ryl>whats the diff between using die
[08:11]<ryl>and a negative if statement wich echo
[08:11]<wjppyn6au>Including mysql_error() can begood or bad, depending on if you ok with joe public seeing the error
[08:11]<ryl>no i wont include that
[08:12]<ryl>i just copy pasted that from some site
[08:12]<ryl>but i wont have the error, lol
[08:12]<wjppyn6au>die() dies, ie takes it's bat-n-ball and goes home immediately
[08:12]<ryl>so pretend the text is the same, "could not connect to db"
[08:12]<ryl>so
[08:12]<ryl>die() is the same thing as echo and exit() ?
[08:12]<wjppyn6au>yup
[08:12]<ryl>then its better to use die() ?
[08:13]<ryl>there are no downsides?
[08:13]<wjppyn6au>probably comes down topersonal taste/style
[08:13]<ryl>ok
[08:13]<ryl>because the if thing can really confuse me, thanks though
[08:13]<ryl>i meant, negative if statements..
[08:13]<wjppyn6au>I use die if I want script to cut and run, and exit to exit gracefully
[08:14]<wjppyn6au>I use meth2 for my db connects
[08:15]<wjppyn6au>becuase if db connection not there, might as well drop
[08:16]<ryl>i can also use die for mysql_select_db, right?
[08:16]<ryl>ex: mysql_select_db('somecrap') or die ('some text');
[08:17]<wjppyn6au>Rip, yup and recommended
[08:17]<wjppyn6au>caz' mightr have DB connection, but not access todb
[08:19]<cm2nzmrm>i have 2 array, first array contains: 1,2,3,4,5,6 and second array contains 1,2,3,5. How do i store "4" and "6" in array because there is in second array? is there any function to do that?
[08:19]<tjufgg>Who was trying to do that complementary color thing?
[08:19]<cm2nzmrm>*because number 4 and 6 is not inside second array.
[08:19]<tjufgg>CyberMad: array_difference
[08:19]<tjufgg>or array_diff
[08:19]<tjufgg>something like that
[08:19]<wjppyn6au>CyberMad, array_diff?
[08:19]<cm2nzmrm>thanks :)
[08:20]<cm2nzmrm>i just don't want compare them one by one..
[08:20]<wjppyn6au>Touqen, was Swkid or something like that
[08:20]<tjufgg>aww, he left
[08:21]<tjufgg>I found out how to do it.
[08:21]<tjufgg>Oh wells
[08:21]<tjufgg>Wolfie7AU: There is a way to do array_diff without using array_diff that is more intelligent than just brute forcing it.
[08:21]<wjppyn6au>Probably
[08:21]<cm2nzmrm>what do you mean?
[08:22]<tjufgg>Wolfie7AU: whoops sorry about that
[08:22]<tjufgg>I get confused some times.
[08:22]<tjufgg>That was directed at cybermad
[08:22]<tjufgg>CyberMad: What do you mean what do I mean?
[08:22]<cm2nzmrm>nice.. looks like array_dif is what i want ;) brilliant..
[08:22]<cm2nzmrm>Touqen nevermind
[08:23]<rymrg>https://cakeforge.org/snippet/detail.php?type=snippet&id=1
[08:24]<rymrg>code you paste on the internet turns up in the weirdest places
[08:24]<wjppyn6au>Anypne know a way to test if an array has any values in it? (ie, if empty($arr) only tells me array has elements, wanta way to test if contains any values without loopingthrough each)
[08:24]<rymrg>"MrRecursiveComponent", how odd
[08:25]<tjufgg>Wolfie7AU: in_array
[08:25]<tjufgg>You know you'd find a lot of these answers if you just bothered to look at the manual.
[08:26]<scwym_>can i use this type of syntax in php ? x < 128 ? 255 : 0
[08:26]<wjppyn6au>But isn't that more for searching for a particular value within a array
[08:26]<tjufgg>Skwid_: yes
[08:26]<scwym_>Touqen: just like that ? no ; or anything ?
[08:26]<wjppyn6au>Touqen, I have manual page open at all times, have been sewarch for an answer forthe last 2 hours
[08:26]<tjufgg>...
[08:26]<scwym_>:)
[08:27]<tjufgg>in_array -- Checks if a value exists in an array; from php.net/array
[08:27]<tjufgg>Wolfie7AU: Where have you been searching?
[08:27]<tjufgg>Skwid_: Depends on where in the statement you have the expression.
[08:28]<wjppyn6au>T, yes, and all Iwant is a testif array "contains" anything, not if it contains a certain value
[08:28]<cgvxygjv>does anyone know a way to untar something with php without using a system call to execute tar from the shell or using pear?
[08:28]<wjppyn6au>www.php.net/manual etc
[08:28]<tjufgg>ugh
[08:28]<tjufgg>wtf
[08:28]<rymrg>finished, http://aidanlister.com/repos/v/iCalReader.php
[08:28]<tjufgg>So then why does if (!empty($arr)) not do what you want?
[08:28]<vxggygvxcuv>while ($row = mysql_fetch_array($characterQ, MYSQL_ASSOC)) {
[08:28]<vxggygvxcuv> $charNames[] = $row['characters'];
[08:29]<vxggygvxcuv>What the best wayt to interject a third value in that loop?
[08:29]<rymrg>TheNinthCut: mysql_fetch_assoc might be nicer







