where "="
10 posts by 4 authors in: Forums > CMS Builder
Last Post: October 2, 2009 (RSS)
For example..
The page lists Projects (Projects has its own section)
When you create a project you can select a Project Manager (the project manager options list pulls from the Accounts section)
So on the Projects page
I need it to display projects where "Mr. X" is the Project Manager
Here is the code I have so far.. which needs tweaked:
<?php
require_once "admin/lib/viewer_functions.php";
list($projectsRecords, $projectsMetaData) = getRecords(array(
'tableName' => 'projects',
'where' => " project_manager = '{$accounts['id']}' ",
));
?>
Re: [s2smedia] where "="
<?php echo $fullname;?>
so how can I use that code to filter the projects.
so it would be where project_manager = <?php echo $fullname;?>;
Re: [s2smedia] where "="
By Kenny - September 30, 2009
http://www.interactivetools.com/forum/gforum.cgi?post=74121#74121
Re: [sagentic] where "="
<?php
require_once "admin/lib/viewer_functions.php";
list($projectsRecords, $projectsMetaData) = getRecords(array(
'tableName' => 'projects',
'where' => "project_manager = {$accountid}",
));
?>
I Get this error:
Notice: Undefined variable: accountid in /hermes/bosweb/web255/b2559/ipw.s2smedia/frontdesk/myprojects.php on line 17 getRecords(projects) MySQL Error: 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 ') ORDER BY dragSortOrder, project_status DESC' at line 2
Re: [s2smedia] where "="
By Chris - September 30, 2009
I have a login where when a user logins in it takes them to a page that displays there name using this code:
<?php echo $fullname;?>
I'm not sure how your login system works, but if it's supplying you with a global variable called $fullname, and that's what you want to match on, I don't see why you can't drop it into the WHERE clause:
'where' => " project_manager = '".mysql_escape($fullname)."' ",
If that doesn't work, you'll need to fill us in on a few more details surrounding how $fullname is getting set so we can figure out how to get the "num" for the account you want to filter by.
I hope this helps. Please let me know if you have any questions.
Chris
Re: [chris] where "="
By s2smedia - October 1, 2009
I'm assuming I would need to use that .mysql_escape?
Thanks
Re: [s2smedia] where "="
By s2smedia - October 1, 2009
Fatal error: Call to undefined function mysql_escape() in /hermes/bosweb/web255/b2559/ipw.s2smedia/frontdesk/myprojects.php on line 17
Re: [s2smedia] where "="
By Chris - October 1, 2009
Please post the PHP source code of your myprojects.php page (as an attachment would be best) and we'll see if we can get this sorted out. :)
Chris
Re: [s2smedia] where "="
By Dave - October 1, 2009
Hope that helps!
interactivetools.com