I want to get the admin name after they log in,
and use this variable in the categories.php
is it a session variable?
I tried to echo $admin_name; in categories, but it didn't work![]()
I want to get the admin name after they log in,
and use this variable in the categories.php
is it a session variable?
I tried to echo $admin_name; in categories, but it didn't work![]()
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
I got it, thank you.
Also, i want to know the location of code for categories listing in categories.php
thank a lot~
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.
I can get the admin_id
echo $_SESSION['admin_id'];
but I still can't extract the admin name from the SQL by the code
{
$result = $db->Execute("select admin_name from " . TABLE_ADMIN . " where admin_id = '" .$_SESSION['admin_id'] . "'");
$row = mysql_fetch_assoc($result);
echo $row['Variable_name'];
}
it give Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\~...
how can i fix it ?
as I can get the admin_id after login in
echo $_SESSION['admin_id'];
but I still can't extract the admin name from the SQL by the code
{
$result = $db->Execute("select admin_name from " . TABLE_ADMIN . " where admin_id = '" .$_SESSION['admin_id'] . "'");
$row = mysql_fetch_assoc($result);
echo $row['Variable_name'];
}
it give Warning: mysql_fetch_assoc(): supplied argument is not a valid MySQL result resource in C:\~...
how can i fix it ?
Repeating the same post again isn't very helpful to anybody.
Posting more information about things you've tried will usually get you faster (and definitely friendlier) answers.
1. Why would you expect $row['Variable_name"] to match anything in the original query?
2. If you're going to use the Zen Cart functions to query the database, you need to be consistent in doing so.
You'll find it much easier to use this:
Code:$result = $db->Execute("select admin_name from " . TABLE_ADMIN . " where admin_id = '" . $_SESSION['admin_id'] . "'"); echo $result->fields['admin_name'];
.
Zen Cart - putting the dream of business ownership within reach of anyone!
Donate to: DrByte directly or to the Zen Cart team as a whole
Remember: Any code suggestions you see here are merely suggestions. You assume full responsibility for your use of any such suggestions, including any impact ANY alterations you make to your site may have on your PCI compliance.
Furthermore, any advice you see here about PCI matters is merely an opinion, and should not be relied upon as "official". Official PCI information should be obtained from the PCI Security Council directly or from one of their authorized Assessors.