« first day (976 days earlier)      last day (3986 days later) » 

11:00 PM
@Chris unless you're dealing with garbage collection or opcode caches. Those things are dark voodoo that you never try to understand
 
can someone tell me why this would produce a syntax error?
$sql = '
INSERT INTO picture (
Filename,
Description,
Contact,
Time,
Title,
) VALUES (
"'.mysql_real_escape_string($Filename).'",
"'.mysql_real_escape_string($Description).'",
"'.mysql_real_escape_string($Contact).'",
now(),
"'.mysql_real_escape_string($Title).'",
)
';
print '<pre>'.($sql).'</pre>';
mysql_query($sql);
print 'err: '.mysql_error();
die();
 
pro-tip: the error message typically tells you what the error is
5
 
rofl
 
or, short of that, it tells you where to look
 
yeah, line 67, wich is this line <script> but the syntax error disappears when commenting out/remove the aforementioned code
 
11:07 PM
what the error is and where to look, what more could one want? fix it automatically?
 
that line doesn't appear in the code you posted
 
how common is the word "perilous" in english?
 
quite
 
0
Q: ActiveRecord where_in() with array

TwhylerI have tried a few different approaches to this problem with no solutions so far. I am receiving this error message: Unknown column 'Array' in 'where clause' SELECT * FROM (Articles) WHERE id IN (Array, Array, Array, Array, Array, Array, Array, Array, Array, Array, Array, Array, Array, Array, A...

 
I know, but this is the whole line:
<script>
And the error disappears when removing the aforementioned code block, telling me that the aforementioned codeblock is the issue
Here is the whole block:
$sql = '
INSERT INTO picture (
Filename,
Description,
Contact,
Time,
Title,
) VALUES (
"'.mysql_real_escape_string($Filename).'",
"'.mysql_real_escape_string($Description).'",
"'.mysql_real_escape_string($Contact).'",
"now()",
"'.mysql_real_escape_string($Title).'",
)
';
print '<pre>'.($sql).'</pre>';
mysql_query($sql);
print 'err: '.mysql_error();
die();
?>
<br/><br/>
<form action="finds.php"><input type="submit" name="submit" value="Tilbake" /></form>
</div>

<script>
 
11:09 PM
@TheLastMelody And what is the actual error?
@Twhyler upgrade to 5.4+, and turn on notices
 
hmm, i really thought it's in the 0.xx%, danger/risk would take up most of the space
 
well, it's common in the sense that most people will know what it means
 
@ircmaxell Syntax error on line 67
 
that's not a valid PHP error
is IE giving you that error?
 
@ircmaxell Thanks for the tip, im downloading 5.4 to add to my xampp setup now
 
11:14 PM
I know, but that is the error, and it causes this error:
Parse error: syntax error, unexpected $end in C:\WampServer\www\AltaBotanikk\Upload.php on line 72
Wich is this line:
</html>
 
those are two very different errors, and one doesn't case the other
the new one you pasted is the actual error
And that typically means you have an unmatched {} or ; somewhere
 
@ircmaxell And the new one is caused by the same block of code wich causes the syntax error on an entirely unrelated line
One block of code causing 2 errors
 
that's not possible
it can only cause one error
because these errors are fatal
 
Dreamweaver gives me the syntax one, and the PHP error comes when executing the page
 
ignore dreamweaver
 
11:17 PM
Yeah, but doing that doesnt help me at all
 
why? because PHP tells you what's wrong, and Dreamweaver just sits there and confuses you? So ignoring the confusing piece of the puzzle doesn't help you at all?
 
Dreamweaver is useful for two tings:
1. Telling me when I mistyped/forgot something
2. That small visual window ^_^
@ircmaxell Point
Now then, let's ignore DQ
DW*
And I can't find out where I am missing a ; :/
 
Dreamweaver is useful for one thing: weeding out bad developers... Seriously, ditch that tool ASAP and learn how to use real tools and HTML/CSS
Look at all of your braces, do they match?
 
@ircmaxell I dont use the WYSIWYG part of DW... I use code view ALL the time
 
Ummm, that's somehow worse
How about this: go download SublimeText2
it will tell you exactly where the error is before you even look at it...
 
11:21 PM
Hello everyone, any who can answer this question:
http://stackoverflow.com/questions/17180539/htaccess-url-rewriting
 
@ircmaxell Downloading now, can I use Notepad++ instead?
My DL speed is crap :/
 
@AngelaTaylor Seriously? My first suggestion would be to make your question more specific in terms of what you're asking. Right now it reads like "do this for me" or "just give me code that works". Which is not really constructive or acccepted here. Instead, perhaps try showing what you've tried and what hasn't work, or where you're specifically stuck. Show that you've made some effort (which I am sure you have)...
@AngelaTaylor Additionally, please don't re-post questions. You could have edited the original question...
 
@ircmaxell Being I am using xampp on OSX and not MAMP, its going to be a larger problem upgrading to 5.4, my production server also runs 5.3 so I would like to keep them the same. Any other way to output more info with the error without 5.4?
 
@irmaxell, thanks for the suggession, i will just edit the question.
 
@Twhyler Well, here's a tip that 5.4 would identify, Array happens when you try to use an array() where it's expecting a string. So if you're getting Array, Array, Array, that means the values you're passing are arrays... they shouldn't be ;-)
 
11:29 PM
@ircmaxell Thanks for the reply, I assumed that was the issue, I thought of using a foreach loop and extract the ids out of the array and then run each query individually, just seemed very repetitive to run queries inside the loop? Would it make sense to use the foreach to extract the values into another array and then pass that array to the where_in()?
 
@ircmaxell Now I have sublimetext2 it doesnt tell me anything about any error
 
@Twhyler yeah, that's typically a good way of doing it
@TheLastMelody there's nothing highlighted in red?
 
@ircmaxell Only purple
 
purple?
 
11:30 PM
ius the file named whatever.php?
 
yeah
Maybe purple is red
@ircmaxell All html tags and the die(); is marked purple
 
do you have an opening <?php ?
 
Yupp
And a closing one
 
can you paste the entire file (in a pastebin or gist)
 
11:35 PM
<?php ?
why do you have that question mark after the opening php tag? aren't you sure you're gonna write php code? :P
 
@kaᵠ Didnt see the one behind, assumed he meant <?php
 
@TheLastMelody you need to uncomment line 40
i mean, comment the block only till line 39
as you have killed the closing bracket for the if by mistake
 
@kaᵠ It is official, I am stupid
 
20 mins ago, by ircmaxell
Look at all of your braces, do they match?
 
I know, I only looked at
$sql = '
INSERT INTO picture (
Filename,
Description,
Contact,
Time,
Title,
) VALUES (
"'.mysql_real_escape_string($Filename).'",
"'.mysql_real_escape_string($Description).'",
"'.mysql_real_escape_string($Contact).'",
"now()",
"'.mysql_real_escape_string($Title).'",
)
';
print '<pre>'.($sql).'</pre>';
mysql_query($sql);
print 'err: '.mysql_error();
die();
Didnt think of checking the one before that >.<
 
11:41 PM
@TheLastMelody happens, pay closer attention next time
 
@kaᵠ The worst thing being that this is usually the case, and I feel just as dumb EVERYTIME >.<
 
@TheLastMelody Please don't star things like that ...
 
hey.. @TheLastMelody.. what @HamZa said..., please unstar
 
@HamZa But it was useful?
 
@TheLastMelody Too localized
 
11:42 PM
Ah, okay, sorry
 
@TheLastMelody you star what's useful/funny for everyone, not just you
 
@kaᵠ Thanks for the clarification ^_^
 
'sup @HamZa bit late isn't it?
lol @TheLastMelody
 
That is useful!
I didnt know that until you told me, and others may not know it either?
right?
 
@kaᵠ Yeah, it's almost 2am, I've too many things to do for school. I'm afraid I won't make it sigh
 
11:45 PM
I just got done with the last issue
now to clean the MySQL DB ^_^
Thanks everyone
 
@HamZa need help? whatcha doing?
 
I know "how", but there is just too much work ...
Currently installing XAMPP and messing getting mail() to work
 
Someone helped me out and came up with the following solution that works: $ids = array();
foreach ($query->result_array() as $id)
{
$ids[] = $id['id'];
}

$this->db->where_in('id', $ids);
 
Yup, saw that
 
@ircmaxell why wouldn't this work instead of the above though: $id = array_values($query->result_array());
 
11:47 PM
@HamZa you'd prolly be faster installing a linux on a machine or a VM
 
Yeah, but gonna follow "the master's" tutorial
in fact I only need to use mail()
 
reading through google group discussions that contain code is dreadful -.-
 
@Twhyler because it's a 2 dimensional array
you'd need to get the inner dimension (which you could with an array_map for example):
 
@ircmaxell ok I get that part, would their be an easier solution other than the foreach loop?
 
11:50 PM
What's the protocol when there are two equivalent tags, e.g. stackoverflow.com/questions/tagged/composer-php and stackoverflow.com/questions/tagged/composer . Use both?
 
not easier
@Danack eventually we tie them together
 
@Danack use the main one
 
So apparently this got disclosed a while ago, but ouch, man!
 
@Twhyler You could do $ids = array_map('reset', $query->result_array()); if the ids are all the first elements of the result. Or $ids = array_map(function($v) { return $v['id']; }, $query->result_array()); if not...
 
SQL injection, root exploits and shell injection all in one line of code from solusVM's manager
 
11:51 PM
BUT, why not just use a sub query?
 
if ($_POST['delete']) {
    $xc = $db -> query('SELECT * FROM centralbackup WHERE id = \'' . $_POST['deleteid'] . '\'', true);
    #[...]
    if ($xc[status] == 'failed') {
           exec('php /usr/local/solusvm/system/bus.php -- --comm=deletebackup --serverid=' . $xc['bserver'] . ' --nodeid=' . $vdata['nodeid'] . ' --vserverid=' . $vdata['vserverid'] . ' --filename=' . $xc['filename']);
    #[...]
    }
 }
 
@ircmaxell I wasn't aware CI activerecord supported subquerys, Ill have to check it out some more
 
@Twhyler well, that's the problem (or one of them) with using active record (which is pretty much seen as an anti-pattern)
 
@ircmaxell ah ok, thats interesting. Using CI was my first intro into using active record, it does seem easier but overcomplicates some things from what I have experienced so far.
 
more than some ;-)
 
11:56 PM
can someone tell me why Æ gets replaced by テヲ in the filename of an uploaded file?
 
@ircmaxell thanks for the discussion, any recommendations to an alternative to activerecord? Just plain SQL queries?
 
I am using
<meta charset="utf-8">
<?php
header('Content-type: text/html; charset=utf-8');
?>
AND
mysql_query("SET NAMES 'utf8'");
mysql_query("SET CHARACTER SET 'utf8'");
 
Yeah, and it still doesnt write ÆØÅ properly in the mysql DB
 
11:59 PM
@ircmaxell thats an interesting approach, just stumbled upon this for CI datamapper.wanwizard.eu
 
It can now fetch ÆØÅ properly, but not send
 

« first day (976 days earlier)      last day (3986 days later) »