Hi,

Thank you for your reply!

I have changed the function like this:

function doReg($fname1="",$family1="",$company1="", $MOL1="", $dannum1="",
$bulstat1="", $phone1="", $email1="", $username1="", $password1="",
$payment1="", $maillist1="", $Addr1="", $City1="", $zipcode1="",
$Country1="", $shippingName1="", $shippingFamily1="", $shippingphone1="",
$shippingAddr1="", $shippingcity1="", $shippingzipcode1="",
$shippingCountry1="")
{

  mysql_pconnect ($DB_SERVER, $DB_LOGIN, $DB_PASSWORD) or
die(mysql_error());



 mysql_select_db($DB) or die(mysql_error());
  mysql_query( "insert into users(name,family,company, MOL, taxnum, bulstat,
phone, email, username, password, payment, maillist, Addr, City, zipcode,
Country, shippingName, shippingFamily, shippingphone, shippingAddr,
shippingcity, shippingzipcode, shippingCountry)
values('$fname1','$family1','$company1', '$MOL1', '$dannum1', '$bulstat1',
'$phone1', '$email1', '$username1', '$password1', '$payment1', '$maillist1',
'$Addr1', '$City1', '$zipcode1',
'$Country1','$shippingName1','$shippingFamily1',
'$shippingphone1','$shippingAddr1', '$shippingcity1', '$shippingzipcode1',
'$shippingCountry1')") or die (mysql_error());


}

I think that the problem is not in the insertion string because when write
the function body :
 mysql_pconnect(.....);
mysql_select_db($DB) or die(mysql_error());
mysql_query("insert into ....");

instead doReg() in register.php, everything works. I have inserted some data
in this way.
The problem is that A DATABASE is  NOT SELECTED. This is the message when I
use doReg().

The register.php   is   in the DOCROOT->emagazine.  In the subdirectory
script are "common.inc"  and  "functions.php". In common.inc is this:

<?php
 $DB_SERVER="localhost";
 $DB_LOGIN="admin";
 $DB_PASSWORD="******";
 $DB="emagazine";
 $HTTP_HOST="localhost:3000";
 $DOCROOT="emagazine";

?>

Is it all right? I think that $DB="emagazine"  should work. Here I select
the $DB, which name is "emagazine".

I don't understand what's going on:)



Thank you!

Viktor

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to