RE: [PHP-DB] mysql_connect()
| From: | Sam Masiello | Date: | Tue, 01 Aug 2000 14:41:03 +0000 |
| Subject: | RE: [PHP-DB] mysql_connect() | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-1669@lists.php.net to get a copy of this message | ||
If the same code works on another server, I would say that it is an install
issue. You need to make sure that PHP was compiled with the -with-mysql
flag. Otherwise, the MySQL function set will not be available.
HTH
Sam Masiello
System Analyst
Chek.Com
(716) 853-1362 x289
smasiello@chekinc.com
-----Original Message-----
From: Greg Militello [mailto:greg@dyrectmedia.com]
Sent: Tuesday, August 01, 2000 10:40 AM
To: php-db@lists.php.net
Subject: [PHP-DB] mysql_connect()
I am getting the error message:
"Fatal error: Call to unsupported or undefined function mysql_connect()
in /home/httpd/html/WizardnonJSP/uploadfile.php3 on line 10"
I know my code works, I am just trying to impliment it on a different
server. Out of curiosity do you guys/gals think this is an install
issue?
-Greg
My code (I replaced IP's and such):
<?php
$TheID = $HTTP_GET_VARS[id];
if ($submit) {
$relative = $HTTP_POST_VARS[relative];
$host = "IP";
$username = "user";
$password = "pass";
$db = "profiles";
mysql_connect($host,$username,$password);
mysql_select_db($db);
$data = addslashes(fread(fopen($form_data, "r"),
filesize($form_data)));
$result=MYSQL_QUERY("INSERT INTO binary_data
(description,bin_data,filename,filesize,filetype,relative) ".
"VALUES
('$form_description','$data','$form_data_name','$form_data_size','$form_data
_type','$relative')");
$id= mysql_insert_id();
MYSQL_CLOSE();
$relative = $HTTP_POST_VARS[relative];
header ("Location: newlocation");
exit;
} else {
?>
<HTML>
<HEAD><TITLE>Store binary data into SQL Database</TITLE></HEAD>
<BODY>
<b>Step 4: </b>Complete this if you are ordering our <b><font
color="#FF0000">Wizard
Analysis</font></b><font color="#000000">.</font>
<form method="post" action="<?php echo $PHP_SELF; ?>"
enctype="multipart/form-data">
<input type="hidden" name="relative" value="<? print($TheID);
?>">
File Description:<br>
<input type="text" name="form_description" size="40">
<INPUT TYPE="hidden" name="MAX_FILE_SIZE" value="1000000">
<br>File to upload/store in database:<br>
<input type="file" name="form_data" size="40">
<p><input type="submit" name="submit" value="submit">
</form>
<?php
}
?>
</BODY>
</HTML>
--
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
For additional commands, e-mail: php-db-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net