Thanks Bob, that worked for the snippet in a document but again causes the TV to error.
UserImage
UserImage
Warning: Cannot modify header information - headers already sent by (output started at /home/xxx/public_html/manager/includes/header.inc.php:5) in /home/xxx/public_html/manager/includes/document.parser.class.inc.php on line 2620
« MODx Parse Error »
MODx encountered the following error while attempting to parse the requested resource:
« Execution of a query to the database failed - You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ’’ at line 1 »
SQL: SELECT photo FROM `xxx_site`.`modx_web_user_attributes` WHERE id = ()
[Copy SQL to ClipBoard]
Parser timing
MySQL: 0.0100 s (3 Requests)
PHP: 1239441686.4859 s
Total: 1239441686.4959 s
Basically I’m trying to find the document creators userID, then query the database for a specific table and it’s content and then place that info into a TV as plain text.
So on the document I want the TV to show /assets/images/myimage.jpg for example. The /assets/images/myimage.jpg is stored in a table in modx and I wish to find that info based on the document creator userID. On each of the documents where the TV is available I want it to reflect the creators table info...
document (100) userID (40) createdby (40) TV(/assets/images/user40.jpg)
document (101) userID (42) createdby (42) TV(/assets/images/user42.jpg)
document (112) userID (30) createdby (30) TV(/assets/images/user30.jpg)
I tried this @SELECT in a TV but only works when you hardcode the ID... I need it to pick up the created by ID without hardcoding. How can I make the 40 be replaced with the document creators ID
@SELECT email FROM [+PREFIX+]web_user_attributes WHERE id = (40)