Jump to content

aQ

Members
  • Posts

    66
  • Joined

  • Last visited

    Never

Everything posted by aQ

  1. Is there any way to get info from more than one table at the time? I do it like this (php): mysql_query("SELECT * FROM users"); mysql_query("SELECT * FROM posts"); I am thinking of something like this: mysql_query("SELECT * FROM posts AND SELECT * FROM users");
  2. aQ

    Character sets

    Hello! I'm developing a website where I use some RSS data from an external source. The data comes in UTF-8-format. I get data from my database to find the RSS-feed I want. The problem is that the data from the database comes out like this: http://www.yr.no/sted/Norge/S�r-Tr�ndelag/Trondheim/Trondheim/varsel.xml. The �'s are æ's ø's and å's, all nordic special letters. How do I change the character set in MySQL (PhpMyAdmin). I have tried to change it under "Operations", where I changed it to "utf8_swedish_ci". Does anyone know what to do?
  3. aQ

    [SOLVED] Regexp help

    I finally fixed it using this line: #(http:\/\/www.yr.no\/stad\/Noreg\/[a-zA-Z0-9æøåÆØÅ]+\/[a-zA-Z0-9æøåÆØÅ]+\/[a-zA-Z0-9æøåÆØÅ]+\/varsel.xml)#
  4. Hello there! I'm trying to get some regexp working, but I haven't done this before, so I need some help. I have a text-document with a lot of links I want to get rid of. The syntax of the links are "http://www.yr.no/stad/Noreg/*SOMETHING*/*SOMETHING*/*SOMETHING*/varsel.xml". "*SOMETHING*" is different from link to link. The links does also contain Scandinavian letters like Æ Ø and Å (æ ø and å). At the moment, I've got this, but it doesn't work: $file = file_get_contents("viktigestader.txt"); $find = array("http:\/\/www.yr.no\/stad\/Noreg\/.+\/.+\/.+\/varsel.xml"); $replace = array(""); $done = preg_replace($find, $replace, $file); print $done; I hope you could help me out.
  5. Hi again! I've got a config.php file with some mysql-connection info etc. This file also contains the inclusion of my functions.php (containing all my functions). The index.php is starting with "include_once('config.php');" which I think also will include the functions file. Did that help?
  6. Hello! I've got a problem with one of my functions: Fatal error: Cannot redeclare checkuser() in /path/to/functions.php on line 5 Checkuser is used to check that the user is a real user. I haven't included it more than once, and the error doesn't display at every page-load, only sometimes. Does anyone know what this can be?
  7. aQ

    add \ to " and '

    Addslashes worked. Didn't see that you edited your post. Thank you.
  8. aQ

    add \ to " and '

    That will, as far as I can see, only make the html into < etc. I want the html to display as it is when the page shows, but still be able to add html to my pages using my cms.
  9. Hello! I am looking for a function (I know it exists, but I don't know it's name), that adds a \ in front of " and '. I want to do this, to let me post html codes in my home-made cms. Thank you.
  10. I'm making a new website now. I have two menus, a left menu (175px), and a right menu (200px). I want the content, which is in the middle, to automatically fit in between these two menus. "width: 100%-375px;" does not work... Any ideas?
  11. Hello! I'm trying to use MagpieRSS to get the new mails from my gmail account. I don't want my mail to be cached on my server (which will be a security issue), so I want to disable caching for that feed. I use the same Magpie for other feeds, which I would like to still cache. Is there a way I could do something like this: "$cache = 0" with magpie? Magpie can be downloaded from http://magpierss.sourceforge.net/. Thank you very much if you could help!
  12. I had put the array in "" like this: print "Value: $array[lala][value]"; When I removed the ""'s, it worked.
  13. It only echoes "[0]"... Any ideas?
  14. Hello! I have got an array. In this array, there are multiple arrays. I want to show some of the info in one of the arrays which are inside the main-array. It's like this: $array = Array( [test] => Test, [lala] => Array(with content in it).... ); I thought I just could say "print $array[lala][0];", and it would give me the first value of "lala" in the $array. This does not work, so how can I do it then? Thank you.
  15. Have a look at this article.
  16. It worked when I re-wrote the code, it was pretty much the same, but I'm not sure what did it. The best thing is that it now works. Thanks.
  17. It won't work. Here is my code: $file = file_get_contents("file.php"); $mods = explode("---", $var); print "<textarea rows=50 cols=50>".$file."</textarea>"; $totalmods = count($mods)-3; $find = $_POST[move2]; $replace = $_POST[move1]; $i = -1; while($i++ <= $totalmods){ if($mods[$i] == $_POST[move1]){ print "<p>$_POST[move1]<p>"; $rmod = str_replace('$var .= "'.$mods[$i].'---";', '$var .= "'.$find.'---";', $file); } if($mods[$i] == $_POST[move2]){ print "<p>$_POST[move2]<p>"; $rmod = str_replace('$var .= "'.$mods[$i].'---";', '$var .= "'.$replace.'---";', $file); } } print "<textarea rows=50 cols=50>".$rmod."</textarea>";
  18. Hello! I am trying to move change place of two values of a variable, but it won't work. $var = ""; $var .= "value---"; $var .= "anotherValue---"; $var .= "thirdValue---"; $var .= "andTheLastOne---"; This is what I've got. I use the explode function to divide the variable into an array. Then I want to move "thirdValue---" to "andTheLastOne---", and "andTheLastOne---" to "thirdValue---". Basically to change the values' positions. I have tried using str_replace, but when I replace andTheLastOne--- with thirdValue---, I don't know where to put in andTheLastOne---, I get two thirdValue---, and no andTheLastOne---. You see? It would be great if someone could help me. Thanks.
  19. aQ

    Blog Critique

    Thanks guys! I'll have a look at it.
  20. Hey, that's great. Works exactly as I want!
  21. I have a file with a form, the form is posted to replace the values in the file with the array.
  22. Uhm, I think I was a little unclear. I want to use fwrite to change the values of the array, and let the variable and such stay the same. Thanks.
  23. Hello! I am experimenting a little using Flat files now. I have a file that looks something like this: <?php // variable $var = "asdasd"; // array $array = array("lala", "lalal"); ?> How can I replace the $array's content with for example "array("blablabla", "blabla")" without knowing the old value of it?
×
×
  • 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.