Getting data from tables msql and e-mailing the result

Here is some code that I'm eager to collect data from two tables msql and send by email to a user. (This is to remind the user of their user name and password in a weak security situation - that they have submitted their email address)

I glued some elements of other pages together, hoping it will do what I want.

At present, it fails with the message

"You have an error in your SQL syntax. Check the manual for your version of the MySQL server for the right syntax to use near Test "in line 1", after posting $org as requested (as a test)

I would be grateful if someone can debug this problem, or otherwise advise.

<? php require_once('.. /.. / Connections/tormented3.php');? >
<? PHP
now, the recordset to email a link to the training
$colname_rstSix = "1";
If (isset($_GET['email'])) {}
$colname_rstSix = (get_magic_quotes_gpc())? $_GET ['email']: addslashes($_GET['email']);
}
@mysql_select_db ($database_tormented3, $tormented3);
$query_rstSix = sprintf ("SELECT ck_organisation FROM chk_sixmonth WHERE ck_email = ' %s", $colname_rstSix);
$rstSix = mysql_query ($query_rstSix, $tormented3) or die (mysql_error ());
$row_rstSix = mysql_fetch_assoc ($rstSix);
$totalRows_rstSix = mysql_num_rows ($rstSix);
Recordset to the end
$org = $row_rstSix ["ck_organisation"];
echo $org; temporary test. Yes, it sends a correct text to monitor

now recordset to the Organization link to access details

@mysql_select_db ($database_tormented3, $tormented3);
$query_rstPword = sprintf ("SELECT username, passwords password organization FROM WHERE = ' %s", $org);
$rstPword = mysql_query ($query_rstPword, $tormented3) or die (mysql_error ());
$row_rstPword = mysql_fetch_assoc ($rstPword);
$totalRows_rstPword = mysql_num_rows ($rstPword);

Start with routine e-mail
$start = "your information to update access the website of the mental health of Torbay.
Your host username";// set up the e-mail header
$username = $row_rstSix ["username"];
$pword = $row_rstSix ["password"];
$message. = '$start $username. Your password is $pword\n please update your entries. « ;
If (mail ($email "Recall information Access",
$message, "in: . ((" [email protected] \r\n")) { }
header ('location:http://www.sample.org.uk "") ;// Redirect to the page if the email has been sent successfully
"exit";
} else {}
$error == ' < style p = "color: red;" > an error has occurred, your email could not be sent. Please try again < /p > ';
}

? >

Thank you very much.

I assumed that your first successful query because SELECT... ck_organisation your $org echo printed what you expected.

Isn't the second query SELECT... Organization which is a failure? Have you tried the echo method or die in this query? Or is it the one that displays "the query is empty?

Try changing the following code snippet and we'll see what happens. I've added a couple more conditions where you can send them to the form. I added also oblique (') around the domain names in the second query, just in case any of those are reserved words in MySQL (I don't get them, but they are available in the MySQL online documentation).

mysql_select_db($database_tormented3, $tormented3);
$query_rstSix = sprintf("SELECT ck_organisation FROM chk_sixmonth WHERE ck_email = '%s'", $colname_rstSix);
$rstSix = mysql_query($query_rstSix, $tormented3) or die(mysql_error());
$totalRows_rstSix = mysql_num_rows($rstSix);
if (!$totalRows_rstSix) {
  // no record exists with email $colname_rstSix
  // Alert user and let them try again.
  exit;
}
$row_rstSix = mysql_fetch_assoc($rstSix);
//end recordset
$org = $row_rstSix['ck_organisation'];
echo $org; //temporary test. Yes, it does send correct text to monitor

//now recordset to link organisation to access details
// mysql_select_db($database_tormented3, $tormented3); // not needed. Still selected from above
$query_rstPword = sprintf("SELECT `organisation`, `username`, `password` FROM `passwords` WHERE `organisation` = '%s'", $org);
echo "$query_rstPword
"; $rstPword = mysql_query($query_rstPword, $tormented3) or die(mysql_error()); $totalRows_rstPword = mysql_num_rows($rstPword); if (!$totalRows_rstPword) { // no record in passwords with $org // Decide what you want to do in this situation. // exit; ??? } $row_rstPword = mysql_fetch_assoc($rstPword);

--
Mark A. Boyd
Keep-on-Learnine :-)

Tags: Dreamweaver

Similar Questions

  • Can all help with VI to get data (HEX) serial number and write in the text file

    Hello I am struggling with this problem for 2 months... They get help from different I thought I solved the problem, but of no use yet I stand on zero

    Problem: I need to get data on USB high speed HEXAGON shaped (coming in hexadecimal and be stored in the text file to the hexadecimal format as each hexadecimal value online different I'll also to attach the file)

    Get us ASCII on series or VISA read but when trying to convert to hex as shown in text file making it slower to deal with code, I know that my VI will have to improve more... I'm waiting for suggestions

    Need urgent help...

    Thanks in advance

    Hi Ali Afzal,.

    I think that the attached example can work for you. If not, then try the solution with sending the data to a parallel running the loop and store it there.

    Mike

  • LabVIEW is not able to extract data from a HP4194A and gives me the error code 1073807202.

    I'm trying to get a graph of the impedance of a capacitor of the HP4194A to my laptop and use one or GPIB-USB-HS connection. I downloaded the latest drivers and am using LabView 8.2. Initially I thought it was a connection problem because demand measurement and automation could find the HP4194A, but he has not answered the * IDN? query. However, the HP4194A responded to the ID of the request? which I found by looking at the user manual. What else should try to get the data I need?

    Thank you

    The HP4194A is an old instrument, and as such, it is not unusual for ancient instruments to does not implement does not the SCPI standard commands. Therefore, to have "ID?" instead of "* IDN? That said, what driver do you use? Is this? When you say that you aren't able to pull data, please be more descriptive. Are you an error? If so, what is it? What screws do you use? Do you use an example VI? If so, which? We are not mind readers, don't forget.

  • Using af:poll to refresh and send data in table page and bound to the data in ADF

    Hi all

    Today, I practiced component survey. I'm going with blog post.

    JDeveloper, Oracle ADF & amp; amp; Java: The use of af: poll to refresh and send data in the page and databound chart in ADF

    all feature fine work. but where I stuck in this stage

    • Start your application and make changes to database and see the new user interface in every 4 seconds.

    but reloaded data seems to be always 1.

    I make the changes 3 or four times in db.i may be able to see the changes. but data reloaded always showing me 1.

    public class Mbeans {
        private RichActiveOutputText activeoutputtext;
        private String refreshinfo;
        private int i = 0;
        private RichPanelCollection pcl;
    
    
        public Mbeans() {
        }
    
    
        public void setActiveoutputtext(RichActiveOutputText activeoutputtext) {
            this.activeoutputtext = activeoutputtext;
        }
    
    
        public RichActiveOutputText getActiveoutputtext() {
            return activeoutputtext;
        }
    
    
        public void polllistener(PollEvent pollEvent) {
            // Add event code here...
            BindingContext bindingContext = BindingContext.getCurrent();
            DCDataControl dc = bindingContext.findDataControl("AppModuleDataControl");
            AppModuleImpl am = (AppModuleImpl)dc.getDataProvider();  
            am.getEmployeesView1().executeQuery();
            i = i+1;
            refreshinfo =  "Data Reloaded-" + i+"  Total Row-->"+am.getEmployeesView1().getRowCount();
            AdfFacesContext adfFacesContext = AdfFacesContext.getCurrentInstance();
            adfFacesContext.addPartialTarget(pcl);
            adfFacesContext.addPartialTarget(activeoutputtext);
            
        }
    
    
        public void setRefreshinfo(String refreshinfo) {
            this.refreshinfo = refreshinfo;
        }
    
    
        public String getRefreshinfo() {
            return refreshinfo;
        }
    
    
        public void setPcl(RichPanelCollection pcl) {
            this.pcl = pcl;
        }
    
    
        public RichPanelCollection getPcl() {
            return pcl;
        }
    
    
        public void setI(int i) {
            this.i = i;
        }
    
    
        public int getI() {
            return i;
        }
    }
    

    Thank you

    HM, I do not have the sample

    What place is the bean in? It should be at least in viewScope...

    Timo

  • Extracting data from table without refreshment and without using the tab key.

    Hi friends,

    I have a problem I want to extract data from table without discount in the text field without using the Tab key. When I enter a field value any value then the text corressponding should enter into corressponding textfield without using the Tab key.

    for example. When I get back emp_id 101 in a text field then first_name and last_name, address would come in to the text fields corressponding without refresh and use the Tab key.

    How can I do that.

    Thank you
    Maury

    Hi Maury,

    I guess it's similar to: retrieving data without refreshing rather than Re: value of a textfield should enter into an another textfield without using the TAB ?

    If so, the only change you want to bring on the first is to use the parameter "Onkeyup" instead of "onchange" in the 'HTML Form attributes of the element' element.

    Note, however, that the user must move away from the issue at some point (for example, to click on a button), so the onchange will fire anyway.

    Andy

  • How to get data from one or several times of perticuler dates

    (1) how can we get data from one or more dates perticuler.
    for example. date of 01/01/2011 and time is 00:00:00 to 23:59:59

    and

    (2) how can we get data from one or more dates perticuler.
    from date 01/01/2011 to 01/02/2011 date and time e.g. is from 00:00:00 to 23:59:59.

    can we?

    Hello

    Use a WHERE clause to include only certain lines.
    For example:

    SELECT     *
    FROM     table_x
    WHERE     dt     BETWEEN TO_DATE ( '01/01/2011 00:00:00'
                        , 'DD/MM/YYYY HH24:MI:SS'
                        )
              AND     TO_DATE ( '01/01/2011 23:59:59'
                        , 'DD/MM/YYYY HH24:MI:SS'
                        )
    ;
    

    In this example, the first date (before the keyword AND) and second (after the keyword AND) lie on the same calendar day. It's just a coincidence, they can be on different dates.
    The first date must not be later than the date of the second; If this is the case, you will get 0 found lines.

    I hope that answers your question.
    If not, post a small example of data (CREATE TABLE and only relevant columns, INSERT statements) for all tables and also post the results desired from these data.
    Explain, using specific examples, how you get these results from these data.
    Always tell what version of Oracle you are using.

  • How to recover data from table

    I'm new to APEX 4.0, how to recover data from table

    My table is CR_USERPROFILE... and I want to recover data to the following recommendations:

    Select the title, user name, address, email, mobile, cr_userprofile where e-mail is APEX_CUSTOM_AUTH. GET_USERNAME


    Text P110_EMAIL 10 field
    20 P110_TITLE selection list
    P110_USERNAME 30 text field
    Text field P110_ADDRESS 40
    P110_PHONE 50 text field
    Text P110_MOBILE 60 field

    could any body if you please help...

    Thanks and greetings
    Luke

    Hello

    1. create the process Page.
    2. Select the Data Manipulation
    3. in the category select "Automated line Fetch".
    4 enter the process name, sequence, select "on the load - before the headers" to the point.
    5. specify the owner, table, primary key and the key column primary (Item name contains the primary key).
    6. create a process.
    7. in each element, select "Column of the database" in "the Source Type.

    Kind regards

    Patel Kartik
    ------------------------------------------------------------------------
    http://patelkartik.blogspot.com/
    http://Apex.Oracle.com/pls/Apex/f?p=9904351712:1

  • getting data from two servers?

    Experts-

    We have two servers for the storage of the tables. 1 history 1. current server Prod

    We have same tables in the databases server.

    All the info before one month from the date of the day are stored in database tables history server
    and the rest in database tables current prod server.


    I create reports such as when the user enters a date, OBIEE must check if the date is in a month (30 days) the date today or earlier at 30 days, on this basis, it must get data from historical Server database tables / running production database server.

    How can I implement this?

    I need to create two clusters of connction (RPD records) and develop the same model twice? (One for the historical paintings and one for prod tables?)
    or can I use the technique of fragmentation? If so, can you give me an idea hwow to implement the Fragmentation of this requirement?

    Thank you for your help in advance

    You must use the fragmentation of this requirement. It is not difficult once you understand the basic principle. Nico article read here for details:

    http://gerardnico.com/wiki/dat/OBIEE/fragmentation_content

    The only non-standard bit for you will be to define the criteria of fragmentation on your sources of logical table. This is the part that says BI server to hit source.

    After return here if you get stuck.

    Paul

  • Y510 unable to get data from the camera.

    Hello

    I have a Y510 with Windows Vista 32 bit, 3 GB RAM, only 5 weeks. I get this message when I try to use Veriface, "unable to get data from the camera. The camera may have been disconnected or busy. I reinstalled Vista of the State in which the laptop came, but it does not work. I also updated the bios and install other updates were available. I would appreciate any advice.

    Thank you

    Peter

    I wish it was as easy as press Fn + Esc, I looked through an another Y510 our office and managed to find a process that must be set to Auto, the process is KtmRm. This process cannot be disabled, handicapped, or on a time delay, it must be AUTOMATIC.

  • How can I get data from each associated XMLnode in movieclips separated when you click a line in the combobox

    How can I get data from each associated XMLnode in movieclips separated when you click a line in the combobox?

    A sample of XML is like this:

    <>planter

    < Lauvtre >

    < Botanisk_navn > Acer campestre < / Botanisk_navn >

    < Norsk_navn > Naverlonn < / Norsk_navn >

    Gronn < Farge > < / fan >

    H4 < Herdighet > < / Herdighet >

    < Hoyde > 10-15 m < / Hoyde >

    < / Lauvtre >

    I have a combobox where it shows the botanical name and the Norwegian name. But the rest of the info in movieclips seem separate.

    Someone has an idea how to do this? Can I use the trace function maybe? Here is my AS3 code so far:

    var loader: URLLoader = new URLLoader();

    loader.addEventListener (Event.COMPLETE, onLoaded);

    list.addEventListener (Event.CHANGE, itemChange);

    function itemChange(e:Event):void

    {

    your. Text = list.selectedItem.data;

    TB. Text = list.selectedItem.label;

    }

    var xml;

    function onLoaded(e:Event):void

    {

    XML = new XML (e.target.data);

    var it: XMLList = xml. Planter.Lauvtre;

    for (var i: uint = 0; i < il.length (); i ++)

    {

    list.addItem ({data: it.}) Farge.Text ([i]) + "\n"+ it.» Herdighet.Text ([i]) + "\n" + it. Hoyde.text ([i]),

    label: it. Botanisk_navn. Text() [i] + "\n"+ it.» Norsk_navn. Text() [i]});

    }

    }

    Loader.Load (new URLRequest ("lauvtre.xml"));

    Thank you!

    Rheus.

    I don't know what you're trying to do.  but, if you want to fill one combobox with the botanical names and when one is chosen, the other use of logins:

    var loader: URLLoader = new URLLoader();

    loader.addEventListener (Event.COMPLETE, onLoaded);

    list.addEventListener (Event.CHANGE, itemChange);

    function itemChange(e:Event):void {}

    var selectedObj:Object = a [list.selectedIndex]

    trace (selectedObj ['fan'], selectedObj ['Botanisk'], etc);

    }

    var xml;

    var a: Array = [];

    function onLoaded(e:Event):void {}

    XML = new XML (e.target.data);

    var it: XMLList = xml. Lauvtre;

    for (var i: uint = 0; i

    list.addItem({label:il[i].child('Botanisk_navn').toString()});)

    a [i] = {'Fan': it [i].child('Farge').toString (), 'Herdighet': it [i].child('Herdighet').toString (), "Hoyde": he [i].child('Hoyde').toString (), 'Botanisk':il[i].child('Botanisk_navn').toString(),'Norsk_navn':il[i].child('Norsk_navn').toString()};}

    }

    }

    Loader.Load (new URLRequest ("test.xml"));

  • How to get data from excel

    Hello world

    How can I get data from excel inside my program? I'm using labview 8.2. I have tried to find the solution for this but seems that the solutions are not suitable. Can someone help me? Thank you.

    Hi jieah,

    Inside of the attachment nijams don't you see this?

    read_excel_values. LLB

  • Get data from a member of the region partitioned customer

    Hello

    I have a partitioned area, this region is in all 3 members, is it possible to get data from this region but only from 1 member of the customer, if so how?

    What is your definition of the region on the server? The three members have given? You set redundant copies? In addition, if the optimizeForWrite() of the service method returns false, the function will run the smallest number of nodes.

    Follow these steps:

    The redundant copies of the value = 1

    Returns true for optimizeForWrite()

    Make sure that all members contain primary buckets

    Perform function like you do above

    Barry

  • Get data from a dBASE - .dbf.

    Hello everyone - Hello work Sunday: (.) I need to get data from legacy applications that run the dbase program. You'll need to auto data. If you have an idea, please tell me. Thanks to you, NIC.

    >

    Hello everyone - Hello work Sunday: (.)

    I do not work yet--it's sad that :)

    I need to get the data from the old application
    running the program dbase. You'll need to auto data. If you have an idea, please
    say to me.

    Have a look here http://asktom.oracle.com/pls/asktom/f?p=100:11:0:P11_QUESTION_ID:711825134415.

    It worked for me, with a bit of difficulty – mainly because of my own stupidity... If you have
    no problem, post back.

    HTH,

    Paul...

    Thanks to you, NIC.

  • Extracting data from Siebel, OPA and impose rules on this

    Hi all

    We have a scenario:

    OPA is used as the server front-end to answer some questions & based on these responses, OPA must validate the data in Siebel and return the result to OPA.

    for example:

    I have a few contracts in siebel, based on my rules in OPA (say, year 2010 > & warranty = 2 years), I need to recover the data that are corresponding to this criterion of Siebel and display in the OPA.

    Can I use OPA connector for Siebel to achieve?

    From now on I saw and heard the examples where connector for Siebel takeover is used when Siebel is the front end application and OPA serves just to validate in the back-end.

    Anticipate some answers.

    Thank you
    Shyam

    You can do this with Siebel connector.

    Specifically, you can use the data in Siebel to begin a session Web determinations then use Web determinations of conduct and maintenance. The results of this interview can then be saved to Siebel.

    See you soon
    Frank

  • Do you know if you can acquire data from a microcontroller that runs under the PLUS + 1 environment, using the NI 9201 platform?

    Hello world

    Do you know if you can acquire data from a microcontroller that runs under the PLUS + 1 environment, using the NI 9201 platform? I need to build a test environment in labview, but entries must be purchased from the microcontroller MC024012 Sauer-Danfoss. The problem is that this microcontroller interface provides the programming amiente MORE + 1 Sauer-Danfoss. Can you help me?

    Thank you

    Elza Figueiredo

    double post and bad advice

Maybe you are looking for

  • How to make a call on my iPhone 6 from Europe to North America?

    How can I make a call on my iphone 6 from Europe to North America?

  • Blurry fonts with IE9 (Nvidia) - W764

    I have a toshiba A660 with Nvidia G330M. Once I've upgraded to ie9 fonts on FB have become rather blurry and difficult to read. I havw tried fix but he does ' t work. Looks like it has something to do with the drivers. It is very difficult to read, o

  • Toshiba Canvio 5 TB carving UBS ports

    Hi, I bought this unit two weeks ago and I have a real problem with an intermittent fault. I tried to reduce the issue down as much as possible, but just when I thought that I solved it, he did it again. Basically I use the drive as my storage drive

  • Portege M300 - do not have the Internet with IE 8

    I have a Toshiba Portege M300 that worked fine until I updated to Explorer 8. After the update, I can't open the web pages, but the antivirus program continues to download the updates, so there seems to be a link. I have uninnstalled Explorer 8, but

  • data execution error, quicktime

    QuickTime fails to open due to data execution prevention error