Database Journal
MS SQL Oracle DB2 Access MySQL PostgreSQL Sybase PHP SQL Etc SQL Scripts & Samples Tips Database Forum Rss Feed

» Database Journal Home
» Database Articles
» Database Tutorials
MS Access
SQL Scripts & Samples
» Database Forum
» Slideshows
Free Newsletters:

News Via RSS Feed

Rss Feed

Database Journal |DBA Support |SQLCourse |SQLCourse2

Featured Database Articles

Database News

Posted Mar 24, 2004

Using JavaScript To Call PHP Database Routines Between Windows

By DatabaseJournal.com Staff

[From PHPBuilder]

In an effort to bring high ease of use, some of us provide a HTML styled select or drop-down list of selections the user can make. It's not too hard to have PHP build a variable that holds a select option list such as:

$OptionList = ""; $First = 1;
while ($Row = mysql_fetch_array($Result, MYSQL_ASSOC)) 
    $ContactID = $Row["ContactID"];
    $Company = $Row["Company"];
    if ($First) 
        $SelMsg = " selected"; $First = 0;
        $SelMsg = "";
    $Line = "<option value='".$ContactID."'".$SelMsg.">".$Company."<l/option>\n";
    $OptionList .= $Line;

We might (I do) have a button on a main screen that says [Select Contact] for the user to make their selection in a second window. This first window has a JavaScript function that opens a PHP page to bring back a number of values from the Contacts database like Company and Name, as read via a key value the user can supply in a form.

The article continues at http://www.phpbuilder.com/columns/gruskoff20040320.php3

Database News Archives

Latest Forum Threads
Database News Forum
Topic By Replies Updated
Efficient SQL Server Indexing by Design lcole 0 April 30th, 12:38 PM
Mine Oracle Database, SQL Server and Other Databases with Monarch Data Pump Pro V10.5 lcole 0 April 30th, 12:37 PM
Oracle Database and Oracle Fusion Middleware for Private Social Network Application lcole 0 April 30th, 12:31 PM
Oracle Database Maintains a Stronghold in the DBMS Market lcole 0 April 30th, 12:30 PM