MySQL Forums
Forum List  »  PHP

Re: mysql_connect(...) = Not working. Where should I start?
Posted by: Luth -
Date: April 07, 2006 05:57PM

There is no query yet. I havent gotten that far. :-/ Eventually it'll contain a map from keyword to functions. But I cant even connect yet. Here is the PHP script in its entirety:


//----------------------------------------------------
<?php

// external use
// Notes: args[0] - Function to call
// args[1] - Host
// args[2] - User
// args[3] - Password
// args[4-10] - function vars, if set



$argstring = $_GET['args'];
if(!isset($argstring)) {
echo("No arguments.");
return 0;
}
$args = explode('|', $argstring);

for($i = 0; $i < count($args); $i++) {
$args[$i] = Decrypt($args[$i]);
}


$command = array_shift($args);
$host = array_shift($args);
$user = array_shift($args);
$password = array_shift($args);


$link = mysql_connect($host, $user, $password);
Process($link, $command);
mysql_close($link);


// internal use only
function Decrypt($string) {
return $string;
}


function Process($link, $command) {
if($link == FALSE) {
echo("Failed to connect: " . mysql_error());
return 0;
}
}
?>
//--------------------------------------------------------


If you have AIM/YIM, please feel free to contact me. It'll help this go faster. :) "LuthCrew"

Options: ReplyQuote




Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.