Net::MySQL

------=_NextPart_000_0026_01C30A6E.486AE070
Content-Type: text/plain;
	charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable

Anyone run into this problem=20

$mysql->query(q{
            INSERT INTO dbname (table_name) VALUES (  $var )
});

The problem is, when I assign a value to a $var that value is ignored in =
the SQL statement.  Ive tried every operator I know to get it to look at =
it and accept the value as input into the DB.  Ive tried=20
( '$var' )
("$var")
("\$var")
([$var])
({$var})

Any ideas ?

Kind regards,

-Daniel  
------=_NextPart_000_0026_01C30A6E.486AE070--

0
drychlik
4/24/2003 7:32:07 PM
perl.beginners.cgi 3839 articles. 0 followers. Follow

6 Replies
847 Views

Similar Articles

[PageSpeed] 51

         The correct query is
         INSERT INTO table_name (table_field) VALUES ( '$var')
         Why dont you use DBI ?

                    Best Regards,


=======================
      Rodrigo Ribeiro Montoro
          Sp0oKeR Labs
    http://www.spooker.com.br
    spooker@spooker.com.br
=======================
----- Original Message -----
From: "Daniel J. Rychlik" <drychlik@tcsconsult.com>
To: <beginners-cgi@perl.org>
Sent: Thursday, April 24, 2003 4:32 PM
Subject: Net::MySQL


Anyone run into this problem

$mysql->query(q{
            INSERT INTO dbname (table_name) VALUES (  $var )
});

The problem is, when I assign a value to a $var that value is ignored in the
SQL statement.  Ive tried every operator I know to get it to look at it and
accept the value as input into the DB.  Ive tried
( '$var' )
("$var")
("\$var")
([$var])
({$var})

Any ideas ?

Kind regards,

-Daniel


---

Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.474 / Virus Database: 272 - Release Date: 18/4/2003

0
spooker
4/24/2003 7:42:21 PM
Ive tried that, I have the get_affected_rows_lenght, and it returns 0
everytime.  The reason I wanted to use the MySQL module is basically just
for conformity.

-Daniel


----- Original Message -----
From: "Sp0oKeR" <spooker@bol.com.br>
To: "Daniel J. Rychlik" <drychlik@tcsconsult.com>; <beginners-cgi@perl.org>
Sent: Thursday, April 24, 2003 2:42 PM
Subject: Re: Net::MySQL


>          The correct query is
>          INSERT INTO table_name (table_field) VALUES ( '$var')
>          Why dont you use DBI ?
>
>                     Best Regards,
>
>
> =======================
>       Rodrigo Ribeiro Montoro
>           Sp0oKeR Labs
>     http://www.spooker.com.br
>     spooker@spooker.com.br
> =======================
> ----- Original Message -----
> From: "Daniel J. Rychlik" <drychlik@tcsconsult.com>
> To: <beginners-cgi@perl.org>
> Sent: Thursday, April 24, 2003 4:32 PM
> Subject: Net::MySQL
>
>
> Anyone run into this problem
>
> $mysql->query(q{
>             INSERT INTO dbname (table_name) VALUES (  $var )
> });
>
> The problem is, when I assign a value to a $var that value is ignored in
the
> SQL statement.  Ive tried every operator I know to get it to look at it
and
> accept the value as input into the DB.  Ive tried
> ( '$var' )
> ("$var")
> ("\$var")
> ([$var])
> ({$var})
>
> Any ideas ?
>
> Kind regards,
>
> -Daniel
>
>
> ---
>
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.474 / Virus Database: 272 - Release Date: 18/4/2003
>
>
> --
> To unsubscribe, e-mail: beginners-cgi-unsubscribe@perl.org
> For additional commands, e-mail: beginners-cgi-help@perl.org
>

0
drychlik
4/24/2003 8:01:09 PM
That was very strange....  I changed the variable name from $name to $var
and it worked....  Sigh, I really dont like little anonying set backs like
that..

IF anyone can explain that one, please Im all eyes...


----- Original Message -----
From: "Sp0oKeR" <spooker@bol.com.br>
To: "Daniel J. Rychlik" <drychlik@tcsconsult.com>; <beginners-cgi@perl.org>
Sent: Thursday, April 24, 2003 2:42 PM
Subject: Re: Net::MySQL


>          The correct query is
>          INSERT INTO table_name (table_field) VALUES ( '$var')
>          Why dont you use DBI ?
>
>                     Best Regards,
>
>
> =======================
>       Rodrigo Ribeiro Montoro
>           Sp0oKeR Labs
>     http://www.spooker.com.br
>     spooker@spooker.com.br
> =======================
> ----- Original Message -----
> From: "Daniel J. Rychlik" <drychlik@tcsconsult.com>
> To: <beginners-cgi@perl.org>
> Sent: Thursday, April 24, 2003 4:32 PM
> Subject: Net::MySQL
>
>
> Anyone run into this problem
>
> $mysql->query(q{
>             INSERT INTO dbname (table_name) VALUES (  $var )
> });
>
> The problem is, when I assign a value to a $var that value is ignored in
the
> SQL statement.  Ive tried every operator I know to get it to look at it
and
> accept the value as input into the DB.  Ive tried
> ( '$var' )
> ("$var")
> ("\$var")
> ([$var])
> ({$var})
>
> Any ideas ?
>
> Kind regards,
>
> -Daniel
>
>
> ---
>
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.474 / Virus Database: 272 - Release Date: 18/4/2003
>
>
> --
> To unsubscribe, e-mail: beginners-cgi-unsubscribe@perl.org
> For additional commands, e-mail: beginners-cgi-help@perl.org
>

0
drychlik
4/24/2003 8:04:58 PM
ok, you know what, this is, How can I say "Annoying".  using the ( '$var')
writes the literal $var in the database, not the value of it.  I spoke to
soon.


----- Original Message -----
From: "Sp0oKeR" <spooker@bol.com.br>
To: "Daniel J. Rychlik" <drychlik@tcsconsult.com>; <beginners-cgi@perl.org>
Sent: Thursday, April 24, 2003 2:42 PM
Subject: Re: Net::MySQL


>          The correct query is
>          INSERT INTO table_name (table_field) VALUES ( '$var')
>          Why dont you use DBI ?
>
>                     Best Regards,
>
>
> =======================
>       Rodrigo Ribeiro Montoro
>           Sp0oKeR Labs
>     http://www.spooker.com.br
>     spooker@spooker.com.br
> =======================
> ----- Original Message -----
> From: "Daniel J. Rychlik" <drychlik@tcsconsult.com>
> To: <beginners-cgi@perl.org>
> Sent: Thursday, April 24, 2003 4:32 PM
> Subject: Net::MySQL
>
>
> Anyone run into this problem
>
> $mysql->query(q{
>             INSERT INTO dbname (table_name) VALUES (  $var )
> });
>
> The problem is, when I assign a value to a $var that value is ignored in
the
> SQL statement.  Ive tried every operator I know to get it to look at it
and
> accept the value as input into the DB.  Ive tried
> ( '$var' )
> ("$var")
> ("\$var")
> ([$var])
> ({$var})
>
> Any ideas ?
>
> Kind regards,
>
> -Daniel
>
>
> ---
>
> Checked by AVG anti-virus system (http://www.grisoft.com).
> Version: 6.0.474 / Virus Database: 272 - Release Date: 18/4/2003
>
>
> --
> To unsubscribe, e-mail: beginners-cgi-unsubscribe@perl.org
> For additional commands, e-mail: beginners-cgi-help@perl.org
>

0
drychlik
4/24/2003 8:10:04 PM
Daniel J. Rychlik wrote:
> ok, you know what, this is, How can I say "Annoying".  using the ( '$var')
> writes the literal $var in the database, not the value of it.  I spoke to
> soon.
> 

Did this ever get resolved?  In the above case I think you are in a 
sense quoting it twice, because of the q{ } you use below combined with 
the single quotes, though I am not sure.  I also missed the $name/$var 
question, what did you mean?  Are you using 'use strict' and 'use 
warnings'??

>>
>>$mysql->query(q{
>>            INSERT INTO dbname (table_name) VALUES (  $var )
>>});
>>

http://danconia.org

0
wiggins
4/25/2003 2:39:04 AM
In my preperation for abadoning the Net::SMTP module It came to me.  Or
rather google came to me and 30 mins later I found someone who had the exact
same problem.  The answer is in the quoting.  Below is the answer.  qq.
$mysql->query(qq{
      INSERT INTO custdb (cust_name) VALUES ('$var')
  });

So you were right.
----- Original Message -----
From: "Wiggins d'Anconia" <wiggins@danconia.org>
To: "Daniel J. Rychlik" <drychlik@tcsconsult.com>
Cc: <beginners-cgi@perl.org>
Sent: Thursday, April 24, 2003 9:39 PM
Subject: Re: Net::MySQL


> Daniel J. Rychlik wrote:
> > ok, you know what, this is, How can I say "Annoying".  using the (
'$var')
> > writes the literal $var in the database, not the value of it.  I spoke
to
> > soon.
> >
>
> Did this ever get resolved?  In the above case I think you are in a
> sense quoting it twice, because of the q{ } you use below combined with
> the single quotes, though I am not sure.  I also missed the $name/$var
> question, what did you mean?  Are you using 'use strict' and 'use
> warnings'??
>
> >>
> >>$mysql->query(q{
> >>            INSERT INTO dbname (table_name) VALUES (  $var )
> >>});
> >>
>
> http://danconia.org
>
>
> --
> To unsubscribe, e-mail: beginners-cgi-unsubscribe@perl.org
> For additional commands, e-mail: beginners-cgi-help@perl.org
>

0
drychlik
4/25/2003 2:13:24 PM
Reply:

Similar Artilces:

ASP.NET + MySQL beginner tutorials?
Since I don't have SQL-server but MySQL installed on the server I use I would like to learn more about using ASP.net and MySQL togheter.Do you know of any neat tutorials?Thanks in advance!/lejdborg Developer in ASP.NET 2.0 and Visual Basic 2005 It will be more or less identical to using SQL Server, so the data access tutorials on this site will probably do.  The main difference will be the connection string: http://www.connectionstrings.com/?carrier=mysql Regards Mike [MVP - ASP/ASP.NET]My site Thank you, will look at that...Is there any way to install MySQL on Visual Studio 20...

Beginner on ASP.NET and MySql
Hi, I am really new to this MySql game with ASP.net, so this may seem a very fresh problem, but any help will be greatly appreciated. using eInfoDesigns.dbProvider.MySqlClient; private void Page_Load(object sender, System.EventArgs e){ DataSet myDataSet = new DataSet(); string connectionString = "Data Source=localhost;" + "Database=test;" + "User ID=root;" +"Password=;" + "Command Logging=false"; MySqlConnection oMySqlConn = new MySqlConnection(connectionString);...

asp.net 2.0 role based security for mysql using mysql/net connector
Hi Guys, I'm nbew to the forumn so here goes. Im currently trying to implement role based security with mysql using the mysql connector thing is i dont know where to start, tutorials that i look at on the internet seem to be based around sql server. I was hoping that somebody out there has implemented this using mysql with the mysql/net connector, Apreciate any and all help guys Many thanks in advance Andy hi, im a newbie to .net and a newbie to this forum so here goes, firstly i want ot create user roles, thing is i cant find a decent tutorial anyway - does naybody know  of o...

MySQL
Currently have a site coded in PHP but the customer wants to go to .NET. Can I use the existing MySQL DB or am I required to use MSSQL? Thanks, Ken Check out this forum which is specialized for this kind of questions: ASP.NET MySQL forumBart De Smet [MVP] Visit www.msdn.be, www.bartdesmet.net...

http://pb2.forenshop.net/cgi-bin/forenserver/foren/F_2359/cutecast.pl <a href="http://pb2.forenshop.net/cgi-bin/forenserver/foren/F_2359/cutecast.pl">Christmas gifts</a> Christmas gifts
Name: Christmas gifts Email: Christmas_at_gifts.com Product: Bon Echo Summary: http://pb2.forenshop.net/cgi-bin/forenserver/foren/F_2359/cutecast.pl <a href="http://pb2.forenshop.net/cgi-bin/forenserver/foren/F_2359/cutecast.pl">Christmas gifts</a> Christmas gifts Comments: ...

mysql and asp.net(vb.net) books
Hi - I am looking for a book that would teach me how to use mysql with asp.net. I have searched Google - can't find any matching titles. Thanks in advance!...

Connector/NET of ASP.NET & MySQL
I'm using Connector/NET to connect to MySQL from ASP.NET 2.0. But the problem is my hosting server only support ODBC connector and I don't want to use it.Is there any solution, such as importing the driver to the application or anything else? Hi, I'm not quite sure if I understood the question, but can't you just copy the MySql.dll to your sites bin directory and use connectionstring that uses localhost as server? Best regards Heiskanen- Heiskanen You can deploy the connector's assemblies with your web application. There is no need to install them on the destination server. This shoul...

System.Net.Sockets.SocketException with MySQL Connector.NET
Hi. I already tried many things and spent already 2 days without any success. Please help or I'll hang myself.I am using MySql.Data.dll  ver. 5.2.5.0 (runtime v2.0.50727) from my project (library). It works great if i use it from WindowsApplication but once i use it same way in WebApplication, it keeps throwing: The attempted operation is not supported for the type of object referencedException Details: System.Net.Sockets.SocketException: The attempted operation is not supported for the type of object referenced .. AsyncResult ias = socket.BeginConnect(endPoint, null, null);.. (or w...

ASP .NET connect to MySQL using ADO .NET...?
Hi guys,Need some advice here as I am new to ASP .NET and ADO .NET. I am currently using MySQL .NET Connector to connect to MySQL database using ASP .NET. I came across this ADO .NET provided by Microsoft which also can connect to a database. Hence,1) Is this the correct manner in terms of technology usage?ASP .NET <-> ADO .NET <-> MySQL DB2) Is there any samples to show such a usage? I search the forums, it seems like there isn't anyone using this manner to connect.Thanks.regards,Aldrick Dont know what version of ASP.NET you are using.  This sample is in 1.1 : http://...

Beginner tutorial for ADO.NET with ASP.NET (VB)?
Does anyone know where there is a beginner tutorial for ADO.NET with ASP.NET (using VB)?  I mean some short, simple, quick and dirty code to:   Connect to a database Create a dataset with a select query How to use a couple of parameters in your select query Update Records Insert Records Delete Records Record Navigation (move first, move last, etc.) Etc.   And I mean code, no GridView stuff.  Just something to get someone started in the right direction that used ADO in the past before .NET.  Something that shows the basics ...

mysql and .net
Hi there, i am new to .net and i am trying to setup a simple form. I am an open source person and what i am asking can be done easily using php and mysql; but i need to know how to do this in .net project asap. i have three forms; form1 submit to the database and redirect to form2 and form2 submit to the database and redirect to form3. i want to grab mysql last inserted id from form1 to form2 while redirecting and pass it via the url. i am able to select from the database, but i don't know how to assign it to a variable; here is what i have so far: str2 = "select last_ins...

.NEt beginner
I worked with ASP earlier on Windows 2000. Now I got XP on my machine & .NET 3.5 is what rules now. Tied up with ASP now are AJAX, IIS, Visual Web developerI came here http://msdn.microsoft.com/theshow/episode.aspx?xml=theshow/en/episode056/manifest.xml looking for IIS7 where next?????For AJAX I visited http://www.asp.net/ajax/downloads. I have 3 options now 1- ASP.NET AJAX Control Toolkit 2- Microsoft AJAX Library 3.53- The ASP.NET 3.5 Extensions Preview Which one should I go for? There is also Visual Web Developer where do I get that from What are the directories in which I would ...

from CGI to CGI
------=_NextPart_000_0013_01C1A1E1.125E2D80 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Hello, I have a small problem. I would like to know some function=20 to redirect the control flow from a perl CGI to another perl CGI, e.g.: CGI 1 (at some place) = CGI 2 (at http://www.java.sun.com/manuals/index.cgi) -------- = = -----------------------------------------------------------------------...

.Net Beginner
Hi.. Can someone help me please... I'm new to the .Net thing. When I create an aspx page using WebMatrix and save it to a folder on my webprovider (.Net capable), I get the following error. Isnt creating an aspx page as simple as asp page ? What am I missing ? Runtime Error Description: An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine. Details: To ena...

Web resources about - Net::MySQL - perl.beginners.cgi

Resources last updated: 12/6/2015 12:39:27 AM