hi,
i think ur database is not getting connected.
try this - ---
$link = mysql_connect($hostname,$username, $password);
if(!$link)
{
echo "couldnt connect to server";
die();
}
mysql_select_db($dbname,$link);
if(!$db)
{
echo "database not found";
die();
}
On Tue, Apr 15, 2008 at 11:41 AM, HardyBoyz <[EMAIL PROTECTED]> wrote:
> Try using quotation mark in each of values. so this code
> ($vrb1,$vrb2,$vrb3,$vrb4,$vrb5)
> change to
> ('$vrb1','$vrb2','$vrb3','$vrb4','$vrb5'). i had a problem like u long
> time ago.
>
> Tedit kap <[EMAIL PROTECTED] <teditkap%40yahoo.com>> wrote: Hi,
>
> The code below takes variables vrb1 through vrb5 from a form and it is
> supposed to update a database. It is displaying the results coming from the
> form on the screen (so the form works correctly) but this code can not
> update the database, displaying "I could not update the database" as below -
> and when I check it is really not updated. Can anybody tell me why it can
> not update the database? The columns written here also match with database
> columns.
>
> <?php
> //Connect To Database
> $hostname='..............';
> $username='.............';
> $password='........';
> $dbname='.............';
> $usertable='table1';
>
> mysql_connect($hostname,$username, $password) OR DIE ('Unable to connect
> to database! Please try again later.');
> mysql_select_db($dbname);
> $vrb1=$_POST['vrb1'];
> $vrb2=$_POST['vrb2'];
> $vrb3=$_POST['vrb3'];
> $vrb4=$_POST['vrb4'];
> $vrb5=$_POST['vrb5'];
> echo "updated database as follows: " ;
>
> echo $vrb1 .$vrb2. $vrb3. $vrb4. $vrb5;
>
>
> $query="INSERT INTO table1 (iid, title1, par1, par2, par3) VALUES
> ($vrb1,$vrb2,$vrb3,$vrb4,$vrb5)";
> mysql_query($query) or die (' I could not update the database');
>
>
> ?>
>
> __________________________________________________________
> Be a better friend, newshound, and
> know-it-all with Yahoo! Mobile. Try it now.
> http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ
>
> [Non-text portions of this message have been removed]
>
>
>
>
>
> Jualan Hosting
> www.magnet-id.com
>
> Jualan Bandwith
> www.lintaswave.net.id
>
> between 0000-00-00 and 9999-99-99
>
> [Non-text portions of this message have been removed]
>
>
>
[Non-text portions of this message have been removed]