473,653 Members | 3,000 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

(PDO) database entries are not possible, even without errorfeedback!

Hi!
I am trying to insert with PDO-Sqlite rows through a form. I can do
whatever I want, I don't find the sollution where I made the error.
Perhaps somebody of you could help me?!

However, the database is created with sqlite, and the entries should be
done with PDO_SQLITE. However, no entries are done anyways and I am one
step going nuts, specially because I don't receive no warning or
errormessage on the screen.

For any help, I would thank you very much.

Tamer
Code:

<?php
require_once('H TML/Form.php');
require_once('I 18N/UnicodeString.p hp');
require_once('H TML/Table.php');

class Formular
{
private $ServerVar = array("Auswahl" ,"Betreff","Ein gabe");
function __construct()
{

$this->ServerVar["Auswahl"] = $_GET['Auswahl'];
$this->ServerVar["Betreff"] = $_GET['Feld'];
$this->ServerVar["Eingabe"] = $_GET['Eingabe'];
$this->MeinFormular() ;
//$this->sqdb();
if(($this->ServerVar["Betreff"] === null) or
($this->ServerVar["Eingabe"] === null))
{
$this->MeineDB();
$this->TextFeld();
}
elseif (($this->ServerVar["Betreff"] === "") or
($this->ServerVar["Eingabe"] === ""))
{
$this->MeineDB();
$this->TextFeld();
}

else
{
$Auswahl = $this->ServerVar["Auswahl"];
$Betreff = $this->ServerVar["Betreff"];
$Eingabe = $this->ServerVar["Eingabe"];
$this->MeineDB2($Ausw ahl,$Betreff,$E ingabe);
$this->TextFeld();
}

}
private function MeineDB()
{

try
{
$dbh = new
PDO('sqlite2:/home/tamer/public_html/citybaker/WebContent/mysqlitedb');
$sql = 'select * from Daten';

foreach ($dbh->query($sql) as $row)
{
//print_r($row);
}
$this->ServerVar = $row;
$dbh = null;
}
catch (PDOException $e)
{
die("Can't connect!");
}
}

private function Datei()
{
$Eigen =
fileowner('/home/tamer/public_html/citybaker/WebContent/formular.sq2');

print(fileperms ('/home/tamer/public_html/citybaker/WebContent/formular.sq2')) ;
//print($Eigen);
}

private function MeineDB2($selec tion,$subj,$inp ut)
{
switch ($selection)
{

case 0:
$selection = 'Deutsch';
break;

case 1:
$selection = 'Englisch';
break;
case 2:
$selection = "Arabisch";
break;
}

$DBWerte = 'insert into Daten
values('.'"'.$s election.'","'. $subj.',"'.$inp ut.')';
//print($DBWerte) ;
try
{
$dbh = new
PDO('sqlite2:/home/tamer/public_html/citybaker/WebContent/mysqlitedb');
//$dbh->beginTransacti on();
$dbh->exec($DBWerte) ;
//$dbh->commit();
$dbh = null;
$this->ServerVar = $row;

}
catch (PDOException $e)
{

//$dbh->rollBack();
echo "Failed: ".$e->getMessage() ;
}

}

private function MeinFormular()
{
$Sprachen = array('deutsch' ,'englisch','ar abisch');
$Formular = new
HTML_Form("Form ular.php",'get' ,'Meinformular' ,'',"text/plain","accept-charset=utf-8");
$Formular->addSelect("Aus wahl","Auswahl" ,$Sprachen);
$Formular->addText("Feld" ,"Betreff",null ,50,50);
$Formular->addTextarea("E ingabe","Eingab efeld",null,50, 10,10);
$Formular->addSubmit('sub mit','absenden! ');
$Formular->display();
}

private function TextFeld()
{
$TabelleAttribu te = array("border"= >"1");
$Tabelle = new HTML_Table($Tab elleAttribute,0 ,false);
$Tabelle->addCol($this->MeinArrayText) ;
print($Tabelle->toHtml());
}

private function sqdb()
{
if ($db = sqlite_open('my sqlitedb', 0666, $sqliteerror))
{
sqlite_query($d b, 'CREATE TABLE Daten (sprache varchar(100),be treff
varchar(100),fe ld varchar(1000))' );
//sqlite_query($d b, "INSERT INTO foo VALUES ('fnord')");
//$result = sqlite_query($d b, 'select bar from foo');
//var_dump(sqlite _fetch_array($r esult));
} else {
die($sqliteerro r);
}
}
}
?>
Mar 28 '06 #1
0 1137

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
1234
by: Bryan J Gudorf | last post by:
We at NeuroKode Labs, LLC, are proud to announce the release of Python Database Objects (PDO) 1.0.1. The current release adds support for PostgreSQL via the pgdb Module. As released previously: Python Database Objects (PDO) provides an easy to use Object Oriented API for database developers. PDO utilizes DB-API modules for database access, but allows for a Common Object Oriented API across RDBMS. Thus, PDO can be thought of
0
1288
by: Bryan J Gudorf | last post by:
Python Database Objects 1.1.0 has been released. This fairly stable test release includes support for various databases through the mxODBC module. This release also adds more functionality through commands such as move and moveto, which allow for more dynamic movement through a recordset. As we move forward in the 1.1 series we will be adding support for more databases. Community support and feedback is appreciated so that we can make...
10
3335
by: Bryan J Gudorf | last post by:
PDO, an open source python module for interfacing with RDBMS (SQL databases), has now reached 1.2.0! PDO provides an object oriented API, similar to that of ADO or JDBC, to python developers. PDO features column access by name. This new release adds support for the cx_Oracle, DB2 and adodbapi modules, allowing users to use PDO with a variety of database systems. 9 different DBAPI modules are now supported, allowing for PDO to be used...
0
1569
by: Jon Franz | last post by:
----- Original Message ----- From: "Jon Franz" <jfranz@neurokode.com> To: "Serge Orlov" <sombDELETE@pobox.ru> Sent: Wednesday, November 19, 2003 2:39 PM Subject: Re: Python Database Objects (PDO) 1.2.0 Released > > Yes, if the .open() is an generator then it must return a sequence of > items > > but only one at a time. If the loop body doesn't keep the result object
13
3400
by: SectorUnknown | last post by:
I've written a database (Access mdb) front-end using Python/wxpython/and ADO. However, the scope of the project has changed and I need to access the same data on an MSSQL server. Also, the front-end needs to be cross- platform (Windows and Linux). Does anyone have any suggestions on what database connectivity I should use? I've looked at mxODBC and wxODBC briefly, but am not sure what is the best way to go. BTW, although I would love...
29
3562
by: MP | last post by:
Greets, context: vb6/ado/.mdb/jet 4.0 (no access)/sql beginning learner, first database, planning stages (I think the underlying question here is whether to normalize or not to normalize this one data field - but i'm not sure) :-) Background info:
1
2573
by: David Fowler | last post by:
I'm new to getting in touch with other PHP users/PHP team, so please excuse me if this post is at all inappropriate or in the wrong place. In the current release of PHP (5.1.4) and in the CVS for PHP5.1.* and 5.2.* the SQLite source version only stands at 3.2.8, while the actual realease is now at 3.3.6. What I was wondering is whether or not this could be updated, as there have been numerous bug fixes in the SQLite source in the past 6...
4
3598
by: macca | last post by:
Hi, quite new to design patterns so please humour me. I'm having a little trouble figuring out how to use the singleton pattern to create a database PDO object that I can then refer to in my script. I created the instance with this: class PDO_Singleton{
9
6271
by: Gordon | last post by:
I want to add a feature to a project I'm working on where i have multiple users set up on my Postgres database with varying levels of access. At the bare minimum there will be a login user who only has read access to the users table so that users can log in. Once a user has been logged in successfully I want to escalate that user's access level to one appropriate to their role, which will include switching the postgres user they are...
0
8283
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8704
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8590
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4291
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2707
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.