RE: MySQL query problems

2003-07-16 Thread Jef S
Have you checked the query in an editor to see if they are working?
Just substitute known values in the place of the variables you are
using.


Jef

> -Original Message-
> From: C. Reeve [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 16, 2003 10:16 AM
> To: [EMAIL PROTECTED]
> Subject: MySQL query problems
> 
> 
> Hi,
> 
> Not sure if the problem here is PHP or MySQL, but here we go. I am
> trying to do two queries on a database - one after the other, but the
> second one never seems to get executed. The two queries are identical
> except for two variables. I have checked my form and they are correct
> and are being sent to the PHP script the way they should be.
> 
> The variables are $playerto, $playerfrom, $nameto, $namefrom. The 'TO'
> query is the one that doesn't work.
> 
> Here is my code. Any help is appreciated.
> 
> if ($namefrom != $nameto) {
>   if ($playerfrom != $playerto) {
> 
>   include("2004server.inc");
>   if($error) {
>   include("trades-input.php");
>   exit;
>   }
> 
>   $query1 = "select manager.idn, manager.total,
> roster.idp, position, points from roster join reference
>   join manager where manager.idn=reference.idn and
> reference.idp=roster.idp and manager.idn like '$namefrom' and
>   roster.idp like '$playerfrom'";
> 
>   $result1 = mysql_query($query1) or $mysqlerror =
> mysql_error();
>   if ($mysqlerror) {
>   $error = "$d_base_error$email_error";
>   include("trades-input.php");
>   exit;
>   }
> 
>   $line = mysql_fetch_row($result1);
> 
>   mysql_free_result($result1);
> 
>   $query2 = "select manager.idn, manager.total,
> roster.idp, position, points from roster join reference
>   join manager where manager.idn=reference.idn and
> reference.idp=roster.idp and manager.idn like '$nameto' and
>   roster.idp like '$playerto'";
> 
>   $result2 = mysql_query($query2) or $mysqlerror =
> mysql_error();
>   if ($mysqlerror) {
>   $error = "$d_base_error$email_error";
>   include("trades-inputs.php");
>   exit;
>   }
> 
>   $row = mysql_fetch_array($result2);
> 
>   mysql_free_result($result2);
>   }
> }
> 
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: first time to use MySQL on MS Platform with PHP.

2003-07-16 Thread Jef S
Place an echo in the productsave.php page and check the SQL query. If
the query that is getting passed is correct then the problem is on the
productsave page. Otherwise, your values aren't being passed to the
query.


Jef

> -Original Message-
> From: Andrew [mailto:[EMAIL PROTECTED]
> Sent: Wednesday, July 16, 2003 3:25 AM
> To: Prabu Subroto; [EMAIL PROTECTED]
> Subject: RE: first time to use MySQL on MS Platform with PHP.
> 
> I think it is the code in functions you need to look at or the path in
one
> of
> your ini files :)
> 
> Andrew
> 
> >-Original Message-
> >From: Prabu Subroto [mailto:[EMAIL PROTECTED]
> >Sent: 16 July 2003 10:14
> >To: [EMAIL PROTECTED]
> >Subject: first time to use MySQL on MS Platform with PHP.
> >
> >
> >Dear my friends...
> >
> >I am trying to develop a database application with PHP
> >Version 4.3.2, MS Window 2000, MySQL 4.0.13-nt and
> >Apache 2.
> >
> >I tried to insert a record onto my MySQL but I got
> >this error messages. What do I have to defined to
> >overcome this problem?
> >"
> >Notice: Undefined variable: productid in
> >C:\Programme\Apache
> >Group\Apache2\htdocs\amt\cgi\productsave.php on line
> >15
> >
> >Notice: Undefined variable: itemname in
> >C:\Programme\Apache
> >Group\Apache2\htdocs\amt\cgi\productsave.php on line
> >15
> >
> >Notice: Undefined variable: description in
> >C:\Programme\Apache
> >Group\Apache2\htdocs\amt\cgi\productsave.php on line
> >15
> >
> >Notice: Undefined variable: price in
> >C:\Programme\Apache
> >Group\Apache2\htdocs\amt\cgi\productsave.php on line
> >15
> >
> >Notice: Undefined variable: information in
> >C:\Programme\Apache
> >Group\Apache2\htdocs\amt\cgi\productsave.php on line
> >16
> >Saved successfully
> >"
> >
> >Here is the code of productsave.php :
> >"
> > >include("functions.php");
> >
> >$sql="
> >insert into product (productid, itemname,
> >description, price, information )
> >values ('$productid', '$itemname', '$description',
> >'$price', '$information')
> >";
> >$conn=connection();
> >choosedb();
> >if (mysql_query($sql,$conn)){
> > echo "Saved successfully";
> >}
> >else echo mysql_error();
> >
> >mysql_close($conn);
> >?>
> >"
> >
> >Here is the code of the form which calls
> >productsave.php (it's cgi program):
> >"
> >
> >Data Entry - Product
> >List
> >
> >
> >1.Product
> >ID:
> > >readonly="yes">
> >2.Item
> >Name:
> > >name="itemname">
> >3. >align="left">Description:
> > >name="description">
> >4. >align="left">Price:
> > >name="price">
> >5. >align="left">Information:
> > >name="information">
> > >type="submit" value="Save" src="img/ok.png">
> > >src="img/no.png">
> >
> >
> >"
> >
> >Please tell me. Thank you very much in advance.
> >
> >__
> >Do you Yahoo!?
> >SBC Yahoo! DSL - Now only $29.95 per month!
> >http://sbc.yahoo.com
> >
> >--
> >MySQL General Mailing List
> >For list archives: http://lists.mysql.com/mysql
> >To unsubscribe:
> http://lists.mysql.com/[EMAIL PROTECTED]
> >
> >
> >---
> >Incoming mail is certified Virus Free.
> >Checked by AVG anti-virus system (http://www.grisoft.com).
> >Version: 6.0.501 / Virus Database: 299 - Release Date: 14/07/2003
> >
> 
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



RE: How can I display images from a mySQL Database in a web page?

2003-07-16 Thread Jef S
What I have found that works, in PHP, is using a form that allows the
user to browse for a file or an image. Upon submitting the form the file
is uploaded to a set location on the web server and the name of the file
is added to the database.

When displaying the information associated with the image, write the php
page so it has the image tag and all you do is query the database for
the name of the file. Let php do the rest.

I realize this isn't a php list but this is what I have done in the
past. You can check the www.php.net newsgroups archives for steps on
accomplishing this task.


Good luck,
Jef 

> -Original Message-
> From: Dan Anderson [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, July 15, 2003 4:31 PM
> To: Partap Davis
> Cc: [EMAIL PROTECTED]
> Subject: Re: How can I display images from a mySQL Database in a web
page?
> 
> > I think there is a way to insert binary image data in your html, but
is
> > there any particular reason you need to do that?
> 
> Yes, my client's server is running with particularly restrictive PHP
> safe mode settings and has informed me that dynamic images are a /must
> have/.  :: bangs head against wall. starts to bleed ::
> 
> So, it is relatively easy to store images into a BLOB, and slightly
> tricky to chop them up into the packet size and reassemble them.  But
> trying to figure out how to do this has boggled my mind and I
appreciate
> all the help of the community.  :)
> 
> -Dan
> 
> 
> --
> MySQL General Mailing List
> For list archives: http://lists.mysql.com/mysql
> To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:http://lists.mysql.com/[EMAIL PROTECTED]



ANSI_NULLS and ANSI_WARNINGS

2003-07-10 Thread Jef S
Greetings to all,
 
Using a SELECT Statement, I am trying to pull information from two
separate databases. The query is being run from the database entitled
NETWORK and the other database is called DB1. The result set will be
displayed to a webpage using PHP in a table format. The problem is when
the page runs an error comes up concerning ANSI_NULLS and ANSI_WARNINGS.
The error is as follows:
 
Warning: MS SQL message: Heterogeneous queries require the ANSI_NULLS
and ANSI_WARNINGS options to be set for the connection. This ensures
consistent query semantics. Enable these options and then reissue your
query. (severity 16) 
 
After doing some research I found some information about setting
ANSI_NULLS and ANSI_WARNINGS to "on". However, when I do this it does
not work. The format I was given was.
 
SET ANSI_NULLS on;
SET ANSI_WARNINGS on;
GO;
CREATE PROCUDURE..
 
I am not using a procedure. I am using a SELECT Statement. If I add the
"GO" line, in the order listed above, to the code I get an error stating
that GO is not recognized. When I add both SET commands, in the order
listed above and without GO, I get the same WARNING that is listed
above.
 
Any help in this matter would be appreciated. Thank you in advance for
your assistance.
 
 
Jef