[wplug] Need suggestions
Evan DiBiase
edibiase at mac.com
Sat Oct 20 13:03:55 EDT 2001
You got it :-) Just a few things to quibble about:
On Saturday, October 20, 2001, at 12:56 PM, Romano, Christopher wrote:
> In my opinion, PHP would be trivially easy to learn for you. Quick, what
> does the following function do?
>
> function blackbox() {
> $conn = mysql_connect("localhost","username","secret)
> or die("Could not connect to MySQL database.");
> // Connection info.
// We actually make the connection here.
// $conn is then used as a reference variable to refer to the
connection
> $select_db = mysql_select_db("test", $conn);
> // Selects database and calls $conn
// Selects database using $conn
>
>
> $result = mysql_exec("SELECT snake_id FROM info WHERE
> type='python'");
> // sets up the search procedure
// Executes SQL query and stores result reference in $result
// (Errata: should be mysql_exec("...", $conn) to indicate what
connection to use.
>
> $num = mysql_num_rows($result);
> // numbers the results.
>
> echo "$result pythons in database.<br>";
> // prints the sentence
> }
-Evan
More information about the wplug
mailing list