Author Topic: Warning: Invalid resource type passed to vlibTemplate  (Read 791 times)

0 Members and 1 Guest are viewing this topic.

chris

  • Guest
Warning: Invalid resource type passed to vlibTemplate
on: Mon, 09. December 2002 - 00:06:04
Hello!

I get this message when I try the Example with the database connection

The example where the following error occours is
vlibTemplate_db_simple.php

Error Message in the Browser

Warning: Supplied argument is not a valid resource handle in c:apachehtdocs   emplatelibvlibTemplate.php on line 342

Warning: vlibTemplate Warning: Invalid resource type passed to vlibTemplate::setDbLoop() for Db "MYSQL". in c:apachehtdocs   emplatelibvlibTemplateerror.php on line 84

Can anybody give an advice the solve the problem

Christian

releasedj

  • Guest
Warning: Invalid resource type passed to vlibTemplate
Reply #1 on: Mon, 09. December 2002 - 17:17:30
when you use the setDbLoop function you must pass through the result resource, i.e.:

Code: [Select]

...



$result = mysql_querySELECT id,username,email FROM users;



$tmpl-setDbLooploop1, $result, MYSQL;



...



If you think that you're doing it correctly then put "get_resource_type($result)" after the mysql call to see what result resource it is. It should be "mysql result".

It may be that there's an error with your SQL.
Try:

Code: [Select]

$result = mysql_querySELECT id,username,email FROM users;

              or diemysql_error;



to see if there's a problem there.

If it still isn't working then post the part of the code that isn't working to the forum and I'll take a look.

Regards,

Kelvin

Offline ClausVB

  • Administrator
  • Hero Member
  • *****
  • Posts: 566
    • Homepage: clausvb.de
Warning: Invalid resource type passed to vlibTemplate
Reply #2 on: Mon, 09. December 2002 - 19:45:05
You probably forgot to create the database. Please read my documentation at
http://lamp.clausvb.de/vtpl.htm

---

Du hast wahrscheinlich vergessen, die Datenbank anzulegen (siehe meine Doku).

Du kannst das Beispiel unter
http://lamp.clausvb.de/vtpl.htm
nachlesen.

Gru�
Claus

chris

  • Guest
Warning: Invalid resource type passed to vlibTemplate
Reply #3 on: Mon, 09. December 2002 - 23:25:26
Hallo Claus!

Peinlich, Peinlich.

Habe im SQL-String einen anderen Feldnamen gehabt als in Datenbank
Datenbank=Cities
SQL-String=City

Aber trotzdem danke

Christian

Quote
You probably forgot to create the database. Please read my documentation at
http://lamp.clausvb.de/vtpl.htm

---

Du hast wahrscheinlich vergessen, die Datenbank anzulegen (siehe meine Doku).

Du kannst das Beispiel unter 
http://lamp.clausvb.de/vtpl.htm
nachlesen.

Gru�
Claus