Jump to content

Scaryminds

New Members
  • Posts

    7
  • Joined

  • Last visited

Profile Information

  • Gender
    Not Telling

Scaryminds's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thanks, finally got it happening with json after much muttering: <!DOCTYPE html> <head lang="en"> <title>Test JSON array thingy</title> </head> <body> <?php $filename = "test.txt"; $myarray['First'] = "Hello World"; $myarray['Second'] = "Another World"; $myarray['Third'] = "Finding Nemo"; // write the array file_put_contents($filename, json_encode($myarray)); // test getting that bad boy back $txtarray = json_decode(file_get_contents($filename), true); // access title of $book array $value = $txtarray['Second']; echo "<p>$value</p>"; ?> </body> </html>
  2. This one has me stumped, have tries json and file_put_contents() to no avail. Okay have a text file, see contents below: <?php site['subTitle'] = "Welcome to the Site"; ?> On an administration page I want to change "Welcome to the Site" to "This is Sydney" or some such, and then write out the array so I get <?php site['subTitle'] = "This is Sydney"; ?> Can't work out how to write the array to the text file in the format above, Thanks in advance team.
  3. Cancel this one, wrote a bunch more css to get a heading etc and simply defined size in there. Now I have to work out how to get two things to float right, with the second one directly under the first .... aaarrrggghhhhh!
  4. Trying to put together a widget for my website where I can indicate what my reading queue is currently. First problem is this CSS .textborder {border: 1px solid black; padding: 2px;} How do I restrict the length of the border, as I don't want it to stretch across the page.
  5. Hey thanks Ken, Did cut down the query as it was quite long and involved, but adding your die clause got the root issue Unknown column 'question' in 'where clause' d'uh! Been a while since I worked on the software and there are clearly some bugs we never got around to fixing
  6. Justin any error message being displayed? If the field ID is auto then you don't need to include as it'll updated anyhow. At a glance I would try renaming your third column "name" to something else and see if that makes a difference. Not entirely sure if it will but vaguely remember running into issues with naming conventions before. HTH
  7. Am currently using this code, and actually thinking about it should split the query to an include in order to allow for other database drivers, on the chance we may decide to ditch the old MySQL. But I digress from the question. include($lib."dbconfig.php"); $q = 'SELECT * FROM file WHERE this = "'.$that'"; $result = mysql_query($q); if (mysql_num_rows($result) > 0) If the query doesn't pick up a row I'm getting this error yo, Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in D:\webpages\*\*\admin.php on line 553 So what would be a better way of testing if the query was successful?
  8. Get ready for a bunch of questions, and hey feel free to point out anything I could improve on Will try to post sober, a hard state to be in downunder :-\
×
×
  • 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.