Jump to content


  • Posts

  • Joined

  • Last visited


Profile Information

  • Gender
    Not Telling

kratsg's Achievements

Regular Member

Regular Member (3/5)



  1. So, i guess nobody knows? That sucks.
  2. Hey, I'm having an issue with using Wikipedia's OpenSearch API - it sometimes gives me characters in a unicode format: "\u00f1" and I would like to convert back into a correctly displayed format (in this case, n-tilde; spanish n). Any suggestions?
  3. If you know it is the form of an array, might as well use the empty() function. - http://us3.php.net/empty - if(empty($_POST['menuitem']) && is_array($_POST['menuitem']))
  4. I like to point out the function of "foreach" from php.net/foreach "Unless the array is referenced, foreach operates on a copy of the specified array and not the array itself. foreach has some side effects on the array pointer. Don't rely on the array pointer during or after the foreach without resetting it. " IE: you'll want to pass by reference if you wish to change the original array. Edit: It might help to notice that your echo statement is WITHIN a foreach loop (so it references the copy of the array). You should be able to fix this by changing the one line: foreach ($siteList as $sitePrefix => &$siteAttributes) { This should pass the reference of siteAttributes without making a copy.
  5. Thanks Thorpe. In retrospect, that seemed fairly stupid of me. "Only" mysql had to have the 'real' part.
  6. Let me better phrase this question... Let's say I focus on some of the more commonly used functions in mysql: mysql_connect, mysql_select_db, mysql_query, mysql_fetch_result/array, mysql_real_escape_string, mysql_free_result... It appears that almost all of these exist, except for the "pg"_real_escape_string. Is there a replacement for this or a way to prevent SQL Injection similarly with postgres?
  7. Hey guys, This is probably the best board I can seem to find for this question. Given the whole slew of mysql_xxxxx() functions, can I replace "mysql" with "pg" and expect it to work properly with a Postgres DB? ~kratsg
  8. Hey, So I've tried moving the files into the same directory and still can't get it to work. I'm completely baffled.
  9. Hey Guys, I'm having a problem with a really basic script... it's so basic that I can't imagine what's going wrong at all: $filename = "ip.address"; chdir('../'); $file = fopen($filename,"a+"); The directory looks something like this: -svn/ -public/ --ip.address --html/ ---MYPHPSCRIPT.php I use the chdir('../') to go up one directory (into public/ directory). Inside that is a file called ip.address. Now, I can't even open that file (I can obviously read it as file_get_contents works but I can't write to it). Going with file permissions - I set it to 0777 for the file and it still doesn't work. I'm at a loss. Edit: To clarify, it gives me a "Permission denied in (this php script file) error. Edit 2: allow_url_fopen is set to on for both Global and Local
  10. Hey, I don't particularly have a problem. It was just interesting when I dumped the object to see exactly what happened with the stored values (since I did use a join) and I was wondering if the periods also carried over in the property names: $statement_paginate = "SELECT perms.pid, perms.description, user_perms.expires FROM perms, user_perms WHERE user_perms.fk_uid = '$user_id' AND perms.pid = user_perms.fk_pid ORDER BY perms.pid ASC"; They appear not to. No problem here. Thanks!
  11. Just a quick question for anyone who knows: Does mysql_fetch_*****() always return values from the database in the form of strings (regardless of what data type it is set in the database?) The reason I ask is I did something like the following: while($row = mysql_fetch_object($curr_data)){ var_dump($row); //.... //.... } Which outputted object(stdClass)#1 (3) { ["pid"]=> string(1) "1" ["description"]=> string(35) "Allows user to view survey results." ["expires"]=> string(1) "0" } Now, 'pid' and 'expires' are both set as integers in the database. There's nothing wrong with the values, but rather the type of values they are. ~kratsg.
  12. Can you do the following? After the appropriate variable, write var_dump($friend_statuses) Copy and paste the query that is outputted on the page, go to phpMyAdmin (or whatever you have), run the query, and view the outputted results.
  13. Put single quotes around $phone: $sql = "INSERT INTO $database.`service` (`customer_no`, `serial`, `phone`) VALUES ($customer_no, $serial, '$phone')";
  14. My initial guess is this portion: I believe you need 3 or 4 backslashes (I saw this before) to get a literal backslash. Let me find that post. Edit: Here it is http://www.phpfreaks.com/forums/index.php/topic,301552.msg1427102.html#msg1427102
  • 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.