You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Curtis Vaughan <cu...@npc-usa.com> on 2004/11/12 20:12:16 UTC
[users@httpd] mysql in apache
Using apache 1.3.33 on Debian 3.0 (kernel 2.6)
We are hosting the web site for our main office. As the site is
developed they just send me the files to put on the server. Well, now
they have sent me something that apparently makes a call to mysql. So,
my question is this. What is the minimum packages I need to install in
order to get this to work? (i.e., mysql-common, mysql-server?).
Here's line of code in a *.php file that refers to mysql:
mysql_connect($db[host], $db[user], $db[pass]) or die(mysql_error());
mysql_select_db($db[name]) or die(mysql_error());
then later in the file
$query = "SELECT COUNT(*) AS cnt_ FROM $table[settings]";
$result = mysql_query($query) or die(mysql_error());
$f = mysql_fetch_array($result);
if ($f[cnt_] == 0)
{
$query = "INSERT INTO $table[settings]
(news_per_page)
VALUES
(5)
";
mysql_query($query) or die(mysql_error());
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org
Re: [users@httpd] mysql in apache
Posted by Curtis Vaughan <cu...@npc-usa.com>.
On 12 Nov, 2004, at 11:12, Curtis Vaughan wrote:
> Using apache 1.3.33 on Debian 3.0 (kernel 2.6)
>
> We are hosting the web site for our main office. As the site is
> developed they just send me the files to put on the server. Well, now
> they have sent me something that apparently makes a call to mysql. So,
> my question is this. What is the minimum packages I need to install in
> order to get this to work? (i.e., mysql-common, mysql-server?).
>
> Here's line of code in a *.php file that refers to mysql:
>
> mysql_connect($db[host], $db[user], $db[pass]) or die(mysql_error());
> mysql_select_db($db[name]) or die(mysql_error());
>
> then later in the file
>
> $query = "SELECT COUNT(*) AS cnt_ FROM $table[settings]";
> $result = mysql_query($query) or die(mysql_error());
> $f = mysql_fetch_array($result);
> if ($f[cnt_] == 0)
> {
> $query = "INSERT INTO $table[settings]
> (news_per_page)
> VALUES
> (5)
> ";
> mysql_query($query) or die(mysql_error());
>
>
>
BTW, it would seem that I have to install at least: php4-mysql and
mysql-common, but that then I will have to create a mysql database. Is
that right?
However, they just sent me a bunch of files for web pages. I see data
arrays in certain .php files. But it would seem that such information
would have to also exist in a mysql database. So, if I'm not mistaken,
they still have yet to provide me with the database files?
---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
" from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org