Re: JDBC and MySQL problem, please help.

2002-01-17 Thread TAKAHASHI, Tomohiro
  Hi,

Michael Tam wrote:
 
 Hi All,
 
 I just installed resin-cmp-1.0.5 with Apache1.3.22 and mysql3.23.47.  I
 used m.mmysql.2.0.8 JDBC driver with the following config segment in my
 resin.conf:
 
 
 resource-ref
   res-ref-namejdbc/test/res-ref-name
   res-typejavax.sql.XADataSource/res-type
   init-param driver-name="org.gjt.mm.mysql.Driver"/
[snip]

  Do you use MySQL or MySQL-max?
  MySQL-max supports Transaction but MySQL does not support it.

  MySQL-max does not support Distributed Transaction(Two-Phase Commit).
  And "org.gjt.mm.mysql.Driver" is not for XADataSource.
  So "javax.sql.XADataSource" does not work fine.

-- 
TAKAHASHI, Tomohiro

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php


JDBC and MySQL problem, please help.

2002-01-16 Thread Michael Tam

Hi All,

I just installed resin-cmp-1.0.5 with Apache1.3.22 and mysql3.23.47.  I
used m.mmysql.2.0.8 JDBC driver with the following config segment in my
resin.conf:


resource-ref
  res-ref-namejdbc/test/res-ref-name
  res-typejavax.sql.XADataSource/res-type
  init-param driver-name=org.gjt.mm.mysql.Driver/
  init-param url=jdbc:mysql://localhost:3306/test_tx/
  init-param user=USER/
  init-param password=PASSWORD/
  init-param relaxAutocommit=false/
/resource-ref


The initialization servlet did create and populate tables into a 'test_tx'
db which I created with 'INNODB' type.

When I run the 'Single Table' servlet example, the page showed the data of
two field of two rows under the same column swapped properly.  However, when
I check on the data in the table. The data never got swapped at all.  That's
it, I receive no exception during the process but no swapping effect on that
two piece of data in the table.

   Would someone kindly show me what's I did wrong or what I have missed??


   Many thanks.

Cheers,
Michael

-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




MySQL Problem -- Please help

2001-06-09 Thread Vladimir Kravtsov

I'm using MySQL with PHP (just learned MySQL so bear with me).

Here's a two part program:

Test.php:

html
body
?php 
require(common.php);
CalculateScore(1);
?
/body
/html

Common.php:

?php 
//Global variables
$Sitename=Toplist;
$Siteurl=;
$Links_per_page=50;
$Base_site_url=localhost;
//MySQL stuff
$host=localhost;
$user=root;
$password=pass32;
$database=xtopsites;

//Functions_begin
//Score Calculation


function CalculateScore($id) {
mysql_connect($host, $user, $password);
mysql_select_db($database);

$querytest=insert into sitestats (id, arate, urate, inhits) values (1, 5, 5, 500);
mysql_query($querytest);


$sql = select urate, arate, inhits from sitestats where id = $id;
$r = mysql_query($sql);
$row = mysql_fetch_array($r);

$arate = $row[arate];
$urate = $row[urate];
$inhits = $row[inhits];

if ($hits  3000) { $hits = 3000; }
$score = (($arate * 5) + ($urate * 2) + ($inhits / 100));

echo($score);

//$sql = update sitestats set score=$score where id = $id;
//mysql_query($sql);
}

?



When I run test.php I get this:

Warning: Supplied argument is not a valid MySQL result resource in common.php on line 
27
0 

Here are lines 25-27:
25: $sql = select urate, arate, inhits from sitestats where id = $id;
26: $r = mysql_query($sql);
27: $row = mysql_fetch_array($r);

I thought using the result identifier returned by mysql_query in mysql_fetch_array was 
perfectly legal.

Please help out :)
Thanks alot.



RE: MySQL Problem -- Please help

2001-06-09 Thread Chris Bolt

 I thought using the result identifier returned by mysql_query in
 mysql_fetch_array was perfectly legal.

mysql_query() doesn't always return a valid result identifier if an error
occurs (echo mysql_error()) or if no rows are returned.


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php




Re: MySQL Problem -- Please help

2001-06-09 Thread oltra jean-michel


 When I run test.php I get this:

 Warning: Supplied argument is not a valid MySQL result resource in common.php on 
line 27
 0

 Here are lines 25-27:
 25: $sql = select urate, arate, inhits from sitestats where id = $id;
 26: $r = mysql_query($sql);
 27: $row = mysql_fetch_array($r);

 I thought using the result identifier returned by mysql_query in mysql_fetch_array 
was perfectly legal.

bonjour,

Try: ...where id = '$id';
on line 25

jean-michel


-
Before posting, please check:
   http://www.mysql.com/manual.php   (the manual)
   http://lists.mysql.com/   (the list archive)

To request this thread, e-mail [EMAIL PROTECTED]
To unsubscribe, e-mail [EMAIL PROTECTED]
Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php