Can I use a username of the php session to select a mysql table?

In my site, I have a situation where

$_SESSION ['MM_Username"]

will be the same name as a MYSQL table prepared.

(There will be a limited number of users and tables)

Instead of writing a long series of "else if" to deal with each user of each page, I want to use the $_SESSION ['MM_Username'] to point to the correct MSQL table.

For example

<? PHP $query_rstPalabs = "SELECT * FROM patricia WHERE YesNo > = 1";  ? >

How can I replace the $_SESSION ['MM_Username'] for 'patricia' here in a way that the SQL would choose the table 'patricia '?

Please be aware that I am not a professional designer and wading in the shallows of PHP/MSQL.  I use DW2004MX to help.
Thank you.

Smiffy47,

Assign a variable with $_SESSION ['MM_Username"]. Call the variable in your query:

Example:

$user = $_SESSION ['MM_Username"];

$user WHERE yesno >= 1" ; =""?>

Be sure to use session_start at the beginning of your page so that you are allowed to call session variables in your application.

This should be added before your declaration DOCTYPE (the very beginning of your page).

-ST

Tags: Dreamweaver

Similar Questions

  • can I use ipencil to paint the pictures on ipadpro?

    can I use ipencil to paint the pictures on ipadpro?

    If you have an application that supports it, of course.

  • Can I use automator to change the modified time of a file as its content?

    I use automator to rename a series of images.

    The problem is whenever I change a change of time of amending records file.

    Can I use automator to change the modified time of a file as its content?

    I know that I can use the Terminal to change a date but I have no idea how to do to automate this process

    As you say you know the command to use in the Terminal, and then with Automator, use the Action run the Shell Script after the name change.  The new file name will be passed to the Action run a Shell Script, and from there, you can use touch - r to set the time of the file at the time the name of the new file

  • Can I use my iPhone for the load

    Can I use my iPhone for the load?

    Yes

  • How can I use Office Update without the Office CD?

    How can I use Office Update without the Office CD? On the microsoft Web site, I clicked the options which mean that I would not need the CD (which was not provided with the laptop), but poartway through the service pack update, I get a request for the Office 2000 Professional CD.

    Any suggestions?

    Hello

    Did you mean an office or a note?
    As far as I know the a Note is part of the recovery Image and the CD is not supplied with the unit. In addition, Toshiba units are not delivered with the Office 2000 software.

    However, have you checked to aid either in Word update function?

    You will find an option called verification of updates
    http://Office.Microsoft.com/en-us/officeupdate/default.aspx

    Good bye

  • Can I use PC400 RAM with the Tecra A4 (Pentrium 750)

    Can I use PC400 RAM with the Tecra A4 (Pentrium 750), currently PC333 is mounted.

    Thank you

    I put t know if you can use but AFAIK Toshiba recommends using these modules on the Tecra A4:
    PC2700 256 MB (PA3311U - 2M 25)
    PC2700 512 MB (PA3312U - 2M 51)
    1024MO PC2700 (PA3313U-2M1G)

    Here are the modules of single channel 166 MHz DDR333/PC2700, DDR SDRAM, 200-pin SoDIMM.

  • can I use 2 Mac Pro, the old and the other from different locations with the same apple ID?

    can I use 2 Mac Pro, the old and the other from different locations with the same apple ID?

    Yes. The only problem that I see if Macs were different countries. The method of payment in the account/ID must be associated with the country where the unit is located and you can only buy Apps from the store of the country where the computers are located

  • Can I use my name on the account and CC my wife to Fact?

    Can I use my name on the account and CC my wife to Fact?

    N ° your name must match the credit card used.

    Since you are using his credit card, why not to use his name?

  • Required: a portable charger for an iPhone 4 that can be used in Germany and the United States

    Required: a portable charger for an iPhone 4 that can be used in Germany and the United States

    Does anyone have recommendations?

    The original charger is International, all you need is a converter of pin code.

  • can I use a structure of the event in another structure of the event

    Hello

    Can use a structure of the event in another structure of the event?

    Thank you

    Viviane

    I would put your waveforms in the registers at offset.  You can then use your structure for the main event to trigger on the Show 1... the value change events and process the data, however you need from there.

  • I can't use windows Explorer or the network drive mapping to access my NAS drive more.

    original title: strange NAS problem

    Hi everyone I can't seem to fix this strange problem.

    I can't use windows Explorer or the network drive mapping to access my NAS drive more.
    I am running windows 7 Professional 32-bit on my PC, and until about a week ago she accessed from my PC very well.

    The location could not be reached and have not been able to run since said today that I went to update it and the drive mapped. I'm at my wits end.

    Here is some info.

    I can access to other computers and devices on my network.

    I can access the internet.
    I have a windows XP PC in the House who can always connect to my fine NAS drive (even if it's not mine).
    I PING the NAS drive.
    The NAS drive will do the same if connected via cable or by wireless.

    UPDATE: after the implementation of a shared folder on a Windows XP computer on the same network I am also unable to acsess the part of my PC. So I can assume that I can't browse all share folders or NAS drives on my local network.

    Help, please.

    Thanks for the help, but I fixed my problem

    Here's what I did in case anyone wants to know.

    I went into Device Manager and went to network adapters.
    I then expanded this section and under view changed to display hidden items.
    Several hundred elements appears (for most 6to4 adapters) and I deleted all the.
    Then click scan for new hardware.
    And... everything works again! YAY!

  • can we use different SID at the adcfgclone on dbTier

    Hello

    I want to know if adcfgclone on dbTier and appsTier can we use different SID at the adcfgclone?

    Suppose that my production is PROD and I want to keep the target as a TEST so I use the SID with a different name? or is it necessary to use the same SID as the source environment?

    Thank you.

    Of course, you can!

    You can change the SID, the location of database files, etc..

    Kind regards

    Bashar

  • How can I use statistics for all the tables in a schema in SQL Developer? and how long will it take on average?

    Hello

    How can I use statistics for all the tables in a schema in SQL Developer? and how long will it take on average?

    Thank you

    Jay.

    Select the connection and right-click on it and select schema statistics collection

  • Can I use Illustrator to draw the outline of a photograph and get an outline of art beautiful line of items in the photo?

    Can I use Illustrator to draw the outline of a photograph and get an outline of art beautiful line of items in the photo? I tried to do this by using the Trace of the Image, but I can't select the paths that result and assign a stroke to path. How can I do this?

    Please see the photo

  • Hello, the following problem, I use a PC, can not use Photoshop, you get the text following error message on the computer-Adobe Photoshop CC 2015 has stopped working "close the program". have uninstalled and installed a number of times, but the CC2015 wil

    Hello, the following problem, I use a PC, can not use Photoshop, you get the following error message on the computer-Adobe Photoshop CC 2015 has stopped working " ", "the program '. '. have uninstalled et installed a number sometimes but the CC2015 does not start anyway. Soren

    Please see:

    Re: adobe photoshop cc 2014 has stopped working in windows 8

    Re: Photoshop CC 2015 has stopped working

    https://www.YouTube.com/watch?v=0OUdIZT7C2E

    I hope this helps.

    Concerning

    Megha Rawat

Maybe you are looking for