Re: [PHP-DB] Am I missing something?

2007-01-28 Thread mario
Hi,

I use somethin as

$sql = 'INSERT INTO `text` (`Field`) VALUES (''aaa'')';

Also, check things with var_dump, use mysql_error, echo $sql/$insert and
check whether the query is well formed. 

my best
mario


On Sat, 2007-01-27 at 19:55 -0600, Alexander wrote:
 I fixed my code and it shows up fine now. It says it supposedly enters the 
 data when I input the fields but when I check the MySQL database, the info 
 isn't there.
 
 Here's the fixed code if you wish to test it:
 
 html
 
 body
 
 ?php
 
   function add_to_table( $picture, $thumbnail ) {
  $picture = mysql_real_escape_string($picture);
  $thumbnail = mysql_real_escape_string($thumbnail);
 
  $user = user;
  $pass = password;
  $database = mydata;
 
$link = mysql_connect(localhost, $user, $pass);
 if(!$link) {
   echo 'Error in linking';
 }
 
  $db = mysql_select_db($database, $link);
 
  $insert = 'INSERT INTO domains ( picture, thumbnail ) values( 
 $picture, $thumbnail )';
  $indata = mysql_query( $insert, $link );
 
 
 }
 
 function write_form() {
  echo form method='post' action='{$_SERVER['PHP_SELF']}';
 
  echo pEnter url of large picture: input type='text' 
 name='picture' /;
 
  echo pEnter url of thumbnail: input type='text' 
 name='thumbnail' /;
 
  echo pinput type='submit' value='Add to Database' /;
 
  echo /form;
 }
 
  if ( !empty( $_REQUEST['picture'] )  !empty( 
 $_REQUEST['thumbnail'] ) ) {
$input = add_to_table( $_REQUEST['picture'], 
 $_REQUEST['thumbnail'] );
  if(!input) {
echo 'Error\!';
  }
  else {
   echo 'Data enter successfully\!';
   $idreturn = mysql_insert_id($input);
   echo 'Image inserted to ID ' . $idreturn;
 }
   }
  else {
write_form();
}
 
 ?
 
 /body
 
 /html 
 
-- 
mario [EMAIL PROTECTED]

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



Re: [PHP-DB] can u help me in PHP

2007-01-28 Thread Niel Archer
Hi

 I read ur reply on newsreader abou mysqli and if i can use it in PHP4
 
 My question is where can i find a link to download the mysqli extension
 separately without changing to PHP5

  The MySQLi extension is available before PHP v5, but I couldn't tell
exactly which version it was introduced with.  I'm pretty certain it's
part of 4.1.
  However, this doesn't mean it is enabled.  If I recall correctly, on a
windows platform it is available as a dll, but needs to be enabled in the
php.ini.  With other platforms, I think it needs to be compiled in with
an additional switch.

Niel

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



Re: [PHP-DB] PHP with a XML database

2007-01-28 Thread Bastien Koert

I would tend to agree with this

Bastien



From: Edward Vermillion [EMAIL PROTECTED]
To: Ritesh Nadhani [EMAIL PROTECTED]
CC: PHP DB php-db@lists.php.net
Subject: Re: [PHP-DB] PHP with a XML database
Date: Fri, 26 Jan 2007 15:36:33 -0600

I would imagine that parsing the XML file you get once a month and  storing 
the information in *some* kind of real database, whether  it's oracle, 
mysql, postgresql or whatever would give you better  performance than 
parsing the XML on each page request. Unless the XML  is of a trivial size 
of course, but I didn't get that impression from  the original post.


Just a thought...



On Jan 26, 2007, at 2:24 PM, Ritesh Nadhani wrote:


Thank you.

I dont think we have the computing power for this project to use  Oracle 
10g. Also, the system is too big and nobody out here has  actual knowledge 
of Oracle but anyway I will keep it in mind.


Ritesh

[EMAIL PROTECTED] wrote:

Ritesh,
Don't know of a suitable XML database to use with PHP, but I could
recommend using Oracle 10g.  There are built in XML services that  should
help with your project.  Furthermore, PHP has a well documented  Oracle
interface (OCI8) just for this.  To handle the XML though, you would
probably need to get to grips with PL/SQL, Oracle's own stored  procedure
and trigger language.  And the best part, you could use OracleXE for
free, although it only gives you a database with up to 4GB user  data, up
to 1GB of RAM and use of only one processor in a multi-processor
environment.
Regarsd,
Neil
-Original Message-
From: Ritesh Nadhani [mailto:[EMAIL PROTECTED] Sent: 26 January  2007 
06:43

To: php-db@lists.php.net
Subject: [PHP-DB] PHP with a XML database
Hello all
As part of my research under my professor I have to implement a web
interface to their benchmarking data.
PHP is the chosen web language but we are little worried about the
database. The benchmark data comes to us in XML format (e.g.  
http://www.matf.bg.ac.yu/~filip/ArgoLib/smt-lib-xml/Examples/ FolEq1.xml)

.
We have to implement an interface to query them, get data, update  etc.
We even can change schema in the form of attributes. . The data size
would be around 100 MB each XML with around 100 different XMLs.
The load would be max 5-10 users any given time, batch updates once a
month and heavy load prolly 2-3 times a month. Mission criticality is
not important, we can get it down sometimes. Which db would you  suggest?
i did google research and as of now - I like eXist, Sedna (they  seem to
have good PHP wrapper support) and TImber.
Any suggestions?
Ritesh
--
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 Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



_
Buy, Load, Play. The new Sympatico / MSN Music Store works seamlessly with 
Windows Media Player. Just Click PLAY. 
http://musicstore.sympatico.msn.ca/content/viewer.aspx?cid=SMS_Sept192006


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