PHP Coding
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Codewalkers ForumsPHP RelatedPHP Coding

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Codewalkers Forums Sponsor:
Be the architects of evolution and help create the mobile internet future. It’s your move---enter to win here!
  #1  
Old May 20th, 2002, 04:50 PM
Anonymous Anonymous is offline
Registered User
Codewalkers God 35th Plane (22000 - 22499 posts)
 
Join Date: Apr 2007
Posts: 22,309 Anonymous User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 24
please help me

Hello

I would like to create a form with two text boxes Country and currency.when i enter some data and hit the submit button, the data should be stored in my table.How can i implement this?
My database is Interbase.

Herez how i proceeded so far.
------

html>
<html>
<head>
<title>My Form</title>
</head>
<body>
<?php
$username = "SYSDBA";
$password = "masterkey";
$connection = @ibase_connect('localhost:C:\Programmefilesexample sDatabaseemployee.gdb', $username, $password);
if (!$connection)
{
exit ("Unable to connect to database: $connection");
}
$db = 'insert into COUNTRY(COUNTRY, CURRENCY) values ( );
$bsc = ibase_query($connection, $db);

Country
<br> <input type="text" country="Yourcountry">
<p> Currency
<br> <input type="text" currency="Yourcurrency">
<p>
<input type="submit" name="submit" value="Enter the Data!">
</form>
</body>
</html>

Could some body please help me with the above code.

Thanking you in advance.



Reply With Quote
  #2  
Old May 20th, 2002, 10:15 PM
svein svein is offline
Codewalkers Newbie (0 - 499 posts)
 
Join Date: Apr 2007
Posts: 5 svein User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RE: please help me

Maybe this help.
(If the country and currency fields are text fields in your db you may have to use ' around the variables when inserting into db like this :
$db = 'insert into COUNTRY(COUNTRY, CURRENCY) values ('$country', '$currency');


<html>
<head>
<title>My Form</title>
</head>
<body>
<?php
$username = "SYSDBA";
$password = "masterkey";
$connection = @ibase_connect('localhost:C:\Programmefilesexample sDatabaseemployee.gdb', $username, $password);
if (!$connection)
{
exit ("Unable to connect to database: $connection");
}

if ($go) {
$db = 'insert into COUNTRY(COUNTRY, CURRENCY) values ($country, $currency);
$bsc = ibase_query($connection, $db);
}

Country
<form method="post">
<br><input type="text" name="country">
<p>Currency
<br><input type="text" name="currency">
<p>
<input type="submit" name="submit" value="Enter the Data!">
<input type="hidden" name="go" value="1">
</form>
</body>
</html>

Reply With Quote
Reply

Viewing: Codewalkers ForumsPHP RelatedPHP Coding > please help me


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway