Jump to content

queenielow

New Members
  • Posts

    3
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

queenielow's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Hi thanks alot guys.. i manage to solve the problem on my own. have a great New Year! Qe
  2. HI Both , Thanks alot.. It's work.. My stupidity that thought the function is working in this way. But now i got another problem. which i dont know what's went wrong. this is my code. [code]include 'sqlconnect.php'; $data = file("conv1.csv"); $result = count($data); for ($i=0;$i<=$result-1;$i++){ while (list($k,$v)=each($data)) {   $data[$k] = explode(',', $v); echo  $insert="insert into queenie.test (dataSource,dataSourceRef,multiplierUrn,prefix,firstName,middleName,lastName,address1,address2,address3 ,town,county,postcode,country,email,emailDPflag,sponsorFlag,paymentRefNo,fundraisingCode,recordType, transQuantity,transCurrency,transAmount,transDate,giftAidFlag,giftAidAmount) values ("; for ($i=0; $i<= count($data[$k])-1; $i++) { echo $d="'".trim($data[$k][$i])."',"; } echo "'');"; $sqlquery=odbc_prepare($conn,$insert); $process=odbc_execute($sqlquery) or die; } }[/code] and the output is this :- [quote] insert into queenie.test (dataSource,dataSourceRef,multiplierUrn,prefix,firstName,middleName,lastName,address1,address2,address3,town,county,postcode,country,email,emailDPflag,sponsorFlag,paymentRefNo,fundraisingCode,recordType,transQuantity,transCurrency,transAmount,transDate,giftAidFlag,giftAidAmount) values ('WORLDPAY','182005289','8005220','Ms','Queenie','Low','Low','London','0','0','London','0','NW6 4NA','GB','queenie.low@gmail.com','1','0','182005289','87','1109','1','GBP','1','04/07/2006 09:11:28','1',''); [color=red][font=Verdana]Warning: odbc_execute() [function.odbc-execute]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Line 1: Incorrect syntax near '('., SQL state 37000 in SQLExecute in C:\wamp\www\CR_www\sql-format.php on line 18[/font][/color] [/quote] Please help me, Thanks alot guys
  3. Hi All, I need some guideline on this error. I dont have any idea how can i connect properly using PHP n MSSQL. I tried all methods. I have set up the Data Source ( system and User) The problem is i dont want it to connect to [b]'RELIEF\FRB4340GFX$'[/b] username- because its invalid. here are my script. Is there any way i can tell the system to login using $username instead of fetching it automatically. sorry ( i am totally new with MSSQL), i've done the duplicate in MYSQL- which works FINE. But i need it works in MSSQL. Thanks alot for any helps. Qe  ??? [code] $username=$_GET['username']; $password=$_GET['pwd']; $dsn="DB03"; $sqlconnect=odbc_connect($dsn,$username,$password)or die; $sqlquery="SELECT companyName FROM Customers;"; $process=odbc_exec($sqlconnect, $sqlquery); while(odbc_fetch_row($process)){ $companyName = odbc_result($process,"companyName"); echo "$companyName<br>"; } odbc_close($sqlconnect); [/code] Error message:- Warning: odbc_connect() [function.odbc-connect]: SQL error: [Microsoft][ODBC SQL Server Driver][SQL Server]Login failed for user 'RELIEF\FRB4340GFX$'., SQL state 28000 in SQLConnect in C:\wamp\www\CR_www\sqlserver.php on line 23
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.