Re: [PHP-DB] Output Errors 2

2002-10-22 Thread David Robley
In article <[EMAIL PROTECTED]>, [EMAIL PROTECTED] 
says...
> Unless it is a typo, the line that reads:
> 
> if (image == 'NULL') { echo ''; }
> 
> should read:
> 
> if ($image == 'NULL') { echo ''; }
> ^
> 
> You forgot the $ in front of image.
> 
> HTH
> 
> MB
> [EMAIL PROTECTED] said:
> 
> > Hi sorry back again.
> > 
> > Thanks for helping me get the code right. Sorry being stupid again, I am 
> having problems with an if / else statement.
> > 
> > I am trying the following but it does not seem to work, what the problem 
> is, that I am saying if the image name field in the database is empty to 
> print nothing, and if it contains data to print that field name, as the a 
> href is in the code which pulls the image, if the field is empty it should 
> show nothing, but what happens is the image is shown in the browser and its 
> not blank.
> > 
> > Here is the revised code:
> > 
> > echo (" \n");
> > echo ("$title \n");
> > echo ("$description \n");
> > echo ("  \n");
> > if (image == 'NULL') { echo ''; }
> > else { echo ' height="160">'; }
> > echo (" \n");
> > }}
> > 
> > 
> > If someone can see the problem it would be most helpful.

In addition to Maureen's point, you are currently checking whether the 
variable $image contains the string NULL; you can test for NULL (without 
the quotes) or better, use the function empty() to test whether $image has 
a value.


-- 
David Robley
Temporary Kiwi!

Quod subigo farinam

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




[PHP-DB] Security

2002-10-22 Thread Doaldo Navai Junior
I need RSA cryptography (or another assymetric method) to crypt the data in
my db. How can I do it?

Doaldo
[EMAIL PROTECTED]



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




Re: [PHP-DB] Create Table with AutoIncrement-field in M$ AccessDB

2002-10-22 Thread Ignatius Reilly
What is your problem exactly?

Ignatius

- Original Message - 
From: "Jaap Aikema" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, October 22, 2002 11:58 AM
Subject: [PHP-DB] Create Table with AutoIncrement-field in M$ AccessDB


> I try to make a new table using PHP4 & M$ Access (via ADODB).
> This is the code I use:
> 
> //begin DB-connection to create table
> $db_connection = new COM("ADODB.Connection");
> $db_connstr = "driver={Microsoft Access Driver (*.mdb)}; DBQ=". 
> realpath("database.mdb") ." ;DefaultDir=". realpath("");
> $db_connection->open($db_connstr);
> 
> $table = "CREATE TABLE $pad (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
>   name TEXT(30),
>   email TEXT(30),
>   http TEXT(30),
>   icq TEXT(15),
>   message MEMO,
>   adddate TEXT(15),
>   ip TEXT(15),
>   location TEXT(35),
>   browser TEXT(55),
>   comment TEXT(255),
>   rating INT NOT NULL
>   )";
> $result = $db_connection->execute($table);
> $db_connection->Close();
> //end DB-connection to create table
> 
> when I delete the "AUTO_INCREMENT"-part, the table is created properly, 
> exept for the fact that the 'id' is NOT autoincrement.
> 
> Does anyone have a solution (or workaround)
> 
> Tnanx Aikie
> 
> 
> -- 
> PHP Database Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 


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




[PHP-DB] Create Table with AutoIncrement-field in M$ AccessDB

2002-10-22 Thread Jaap Aikema
I try to make a new table using PHP4 & M$ Access (via ADODB).
This is the code I use:

//begin DB-connection to create table
$db_connection = new COM("ADODB.Connection");
$db_connstr = "driver={Microsoft Access Driver (*.mdb)}; DBQ=". 
realpath("database.mdb") ." ;DefaultDir=". realpath("");
$db_connection->open($db_connstr);

$table = "CREATE TABLE $pad (id INT NOT NULL PRIMARY KEY AUTO_INCREMENT,
 name TEXT(30),
 email TEXT(30),
 http TEXT(30),
 icq TEXT(15),
 message MEMO,
 adddate TEXT(15),
 ip TEXT(15),
 location TEXT(35),
 browser TEXT(55),
 comment TEXT(255),
 rating INT NOT NULL
 )";
$result = $db_connection->execute($table);
$db_connection->Close();
//end DB-connection to create table

when I delete the "AUTO_INCREMENT"-part, the table is created properly, 
exept for the fact that the 'id' is NOT autoincrement.

Does anyone have a solution (or workaround)

Tnanx Aikie


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