I just installed the odbc stuff for linux but I have no idea howw to
do a trace. I didn't find much except advertising on the iodbc site.
How do I do a trace? Where does the output go?
I tried it without UTF-8 encoding. Same story. BTW, why do the values
require encoding while the names of the variables passed dont??
I am using PHP v4.3.3 MySQL v4.0.15.
I did indeed test the php file without the applet with a simple html
form. It worked fine. It's only when data is passed via an applet.
Even stranger, I know the values I'm passing are getting to the php
file because I can echo them back to the java applet and display them.
I just cant feed them to mysql.
Thanks.
Art.
jcsisko@openlinksw.co.uk (Jan Csisko) wrote in message news:<998aac6a.0402270340.6cecba2b@posting.google. com>...[color=blue]
> Hi,
>
> this is quite an interesting setup you got there. Personally, I have
> never tried this using an Java Applet but did create environments
> where JDBC, PHP and
> a database were involved.
>
> Have you tried creating an ODBC Trace in order to see how far the
> applet gets when accessing the database ?
>
> Also, have you tried this data entry using non-unicode data ?
> MySQL only recently started supporting Unicode so I assume you
> are using the latest Version and it might be worth running a test
> using non-unicode data (and a non-unicode DB).
>
> Also, which Version of PHP are you working with at this stage ?
>
> You said that you tested all components seperately, so I would imagine
> that
> you can successfully enter data into MySQL using PHP without the
> applet as
> a front-end. If this is the case the problem must be inbetween the
> applet
> and PHP itself. Either way, an ODBC Trace and doublechecking the PHP
> make
> should shed more light on the cause of this problem. Regarding the
> PHP-ODBC
> interface you might want to have a look at
http://www.iodbc.org.
>
> I hope you will find this to be of help.
>
> Kind Regards,
>
> Jan Csisko
> Professional Services Consultant
> OpenLink Software Web:
http://www.openlinksw.com
> Product Weblogs: Virtuoso:
>
http://www.openlinksw.com/weblogs/virtuoso
> UDA:
http://www.openlinksw.com/weblogs/uda
> Universal Data Access & Virtual Database Technology Providers
>
>
>
>
apchar@yahoo.com (apchar) wrote in message news:<295c858.0402261912.75844959@posting.google.c om>...[color=green]
> > I am trying to use php as a kind of servlet to act as a middle man
> > between a java applet and mysql. I know java has jdbc but it's flakey
> > and painful. php access to mysql is much nicer. So I have:
> > 1. An html page that holds the applet.
> > 2. a php page that accepts data submitted to it by the applet via the
> > $_POST array and writes it to the mysql database. This page never
> > makes it to the browser window.
> > 3. a simple Thank you page that shows up after the applet sends the
> > data.
> > Trouble is, nothing makes it into the mysql database. I've tested each
> > component seperately. I know they work. I know the applet data is
> > posted cuz I tested it with the usual query.php. But when I put them
> > together nothing shows up in the database.
> > What did I do wrong???
> > Heres the java applet. The page that holds it has nothing but this
> > applet.
> >
> > import java.awt.*;
> > import java.net.*;
> > import java.io.*;
> > import java.applet.*;
> >
> > public class CGISQLPost extends Applet
> > {
> > public void init()
> > {
> > try
> > {
> > URL url = new URL("http://localhost/tmp/CGISQLPost.php");
> > URLConnection connection = url.openConnection();
> > connection.setDoOutput(true);
> > PrintWriter out = new
> > PrintWriter(connection.getOutputStream());
> > out.print("id="+URLEncoder.encode("4","UTF-8")+"&name="+URLEncoder.encode("Apchar","UTF-8")+"&title="+URLEncoder.encode("Chieftan","UTF-8")+"\n");
> > out.close();
> > } catch(IOException e)
> > {
> > System.out.println("Oops"+e); return;
> > }
> > repaint();
> > try
> > {
> > getAppletContext().showDocument(new
> > URL("http://localhost/tmp/thanks.html"));
> > } catch (MalformedURLException e)
> > {
> > System.out.println("Oops"+e); return;
> > }
> >
> > }
> >
> > public void paint(Graphics g)
> > {
> > g.drawString("Sending",1,14);
> > }
> > }
> >
> > Here is the php page that processes the data.
> >
> > <html>
> > <head>
> > <title>CGISQLPost</title>
> > <meta http-equiv="Content-Type" content="text/html;
> > charset=ISO-8859-1">
> > </head>
> > <body>
> > <?php
> > $id = $_POST[id];
> > $name = $_POST[name];
> > $title = $_POST[title];
> > $conn = mysql_connect("localhost","web","webster");
> > mysql_select_db("test", $conn);
> > $str = "insert into mytest values ($id,'$name','$title')";
> > mysql_query($str, $conn) or die(mysql_error());
> > mysql_close($conn);
> > ?>
> > </body>
> > </html>[/color][/color]