Jump to content

woozy

Members
  • Posts

    7
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

woozy's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Okay figured it out. Use $template->touchBlock("pageBody"); to display the block but don't replace variables.  Gets a bit complicated though.  If you touch it, you don't want to parse it later or it gets outputted twice.  I think this is Okay.  I think if you replace a variable but not parse but touch the block later it comes out the same...  I hope.
  2. After much struggling where !!!none!!! of my blocks were being parsed, I finally discovered they were parsed if I set a variable. For example: I had a template file called "foo.tmp" consisting of: <html><body>Hello<br> {PAGE_BODY} </body></html> A template scrap file called "goo.tmp" consisting of: <h1>HELLO</h1> and the php file consisting of <?php require_once "HTML/TEMPLATE/ITX.php"; $template = new HTML_TEMPLATE_ITX("."); $template->loadTemplatefile("foo.tmp"); $template->addBlockFile("PAGE_BODY", "pageBody", "goo.tmp"); $template->setCurrentBlock("pageBody"); $template->parseCurrentBlock(); $template->show(); ?> The page would utterly blank and no error would be registered in the server log. BUT  if I edited the php script to have... ... $template->setCurrentBlock("pageBody"); $template->setVariable("GLOM", "whatever"); $template->parseCurrentBlock(); .... THEN the page would render. So... you can't just parse a block without setting a variable?????  Any way around this?
  3. Cool. Solved it! This'll be an issue with MySQL 5 but seems to also be an issue with MySQL > 4.1 (I'm using 4.4.1) MySQL changed the password hashing method from 16 byte to 32 byte encryption. DB.php doing the mysql::user:password@host, uses the old 16 byte encryption. What I did was change the password in MySql using the OLD_PASSWORD() (as opposed to PASSWORD()) function, and change my password to be less secure but PHP compatible. [a href=\"http://dev.mysql.com/doc/refman/5.0/en/old-client.html\" target=\"_blank\"]http://dev.mysql.com/doc/refman/5.0/en/old-client.html[/a] has all the answers. Thanks for pointing me in the right direction!
  4. Oops again. The above result was when I had somehow turned of my MySQL service. *This* is what I get Database connection: Object $q[error_message_prefix] = $q[mode] = 1 $q[level] = 1024 $q = -24 $q[message] = DB Error: connect failed $q[userinfo] = [nativecode=Client does not support authentication protocol requested by server; consider upgrading MySQL client] ** mysql://webreader:reading@localhost/sirentiger $q[backtrace] = Array $q[callback] = ObjectDB Error: connect failed webreader reading localhost sirentiger Soooooo, I guess I better look into authentication protocol and turning it off (or figuring out how to turn it on in php)?
  5. [!--quoteo(post=322108:date=Nov 25 2005, 09:12 PM:name=neylitalo)--][div class=\'quotetop\']QUOTE(neylitalo @ Nov 25 2005, 09:12 PM) 322108[/snapback][/div][div class=\'quotemain\'][!--quotec--] Assign your database connection string to a variable, echo it, and let us know what the result is. And I'm assuming that the DB library is installed by the way it generated the error. I'm not sure what you mean by "connection string" but I rewrote to code as: function get_db($host, $database, $user, $password){ require_once('DB.php'); $q = DB::connect("mysql://$user:$password@$host/$database"); echo "Database connection: $q<br>\n"; $q_array = get_object_vars($q); foreach ($q_array as $k => $v){ echo "\$q[$k] = $v<br>\n"; } echo (DB::connect("mysql://$user:$password@$host/$database")); if (DB::isError($q)){ die($q->getMessage()." $user $password $host $database");} return $q; } and it echoed out: Database connection: Object $q[error_message_prefix] = $q[mode] = 1 $q[level] = 1024 $q = -24 $q[message] = DB Error: connect failed $q[userinfo] = [nativecode=Can't connect to MySQL server on 'localhost' (10061)] ** mysql://webreader:reading@localhost/sirentiger $q[backtrace] = Array $q[callback] = ObjectDB Error: connect failed webreader reading localhost sirentiger I'm a bit confused by what the "10061" is supposed to mean. Is that a port number? If so it's the wrong one and I'm not sure where it got that number from. If so I guess that would be the first place to look. What do you think? Thanks for your help.
  6. Oops. I just notice my variable names don't match in the above post. That *not* the problem. I still don't connect with the right variable names.
  7. I'm actually embarrassed to post this question because it is so general and vague but... well, I'm stumped I recently had to reinstall PHP (4.4.1. for windows) and Mysql Server (4.1) and, well, I can't get a php connect and that is *all* I know. I've written: $db_user = 'webreader'; $db_password = 'w4reed'; $database = 'sirentiger'; $db_host = 'localhost'; $q = DB::connect("mysql://$user:$password@$host/$database"); if (DB::isError($q)){ die($q->getMessage(); } And all I get is a simple message "DB Error: connect failed " And that's it! I've tried rewriting the connect command to use the root account and a variaty of other options. I wouldn't feel so bad trying to debug but I'm not getting *any* response at all. Nothing shows up in the Web Server errer logs, nor in the MySql server error logs or anything. What can I do to trouble shoot? I don't have any idea why it's failing to connect and the message "DB Error: connect failed " is not very informative. Any help appriciated! Thanks.
×
×
  • 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.