Jump to content

BDabrowski

New Members
  • Posts

    6
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

BDabrowski's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. You were right. The manner in which I included them was the problem. I was using a function to load all files in a directory if the directory is present. That function did not have the global $_SITE call. Thus any functions included from it did not have the $_SITE variable. Sorry. Thanks.
  2. Because it's a flow that includes several files and several more directories and I thought I was making it easier to follow. To include every file in it's entirety seemed unnecessarily complex. They're just include 'file.php'; . I've thrown in a few characters of text just to prove to myself that they are including properly. I'll see if I can get more, but I was putting it out to see if there was any general rules I was missing like using $_VARIABLE convention to name a variable or anything else obvious.
  3. index.php includes settings.php $_SITE['root_pages_dir'] = $_SITE['root_inst_dir'] . 'pages/'; includes second_file.php includes inc.last_file.php $qs = "SELECT * FROM " . DBPFX . "pages"; $q = mysql_query($qs); while ($r = mysql_fetch_assoc($q)) { $page_dir = $_SITE['root_pages_dir'] . $r['pages_dir']; echo $page_dir; if (!is_dir($page_dir)) { echo $page_dir; //mkdir($page_dir); } } When the code is in inc.last_file.php, it needs the global $_SITE;/php] line. If it's in [i]second_file.php[/i], it works fine.
  4. I have an array, $_SITE. It's defined early on and I have no problem using it anywhere except here. In an included file, I run a mysql query and use while to grab the rows. If I try to print one of the elements of $_SITE, it doesn't show up. I moved the code up out of the included file and it printed fine. Also, within the included file, if I put global $_SITE inside the WHILE loop, it works. Shouldn't defining functions be the only limitation of scope?
  5. Server version: 5.0.85-community The tables/DB is MyISAM. I've been seeing something about certain types not allowing NULL. Tried the SHOW CREATE TABLE query, but PHPMyAdmn gave me this: Full Texts Table Create Table nhb_users CREATE TABLE `nhb_users` ( `users_id` int(11) NO... I'm sure there's more to it. I've avoided the issue for now, so feel no obligation to follow up, but I'll still be interested to figure it out.
  6. I have a column in a table that is set to allow NULL, and default is NULL. When a record is inserted, with no value, the field is correctly NULL. Every time I run an UPDATE on the table, the field becomes an empty string. The syntax I'm using is SET field=NULL, otherfield . . . .etc. I've written the query back to the screen to ensure that it is attempting the proper query. I get no mysql errors, but it keeps setting the field to a empty string. In PHPMyAdmin, if I run the UPDATE query with the SQL tool, it still makes the field an empty string. The only way I can set an existing record back to NULL is to select to edit the record and use PHPMyAdmin's form to run the query. After setting the field back to NULL with the pre-built form, I can even copy and paste the query that the form created back into the SQL tool and it still inserts an empty string rather than NULL, when that exact same query just inserted the NULL value via the form. The host says it's a programming issue. What am I missing?
×
×
  • 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.