Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.javascript > #24187 > unrolled thread

Can javascript work with mysqli?

Started byrichard <noreply@example.com>
First post2014-05-16 10:40 -0400
Last post2014-05-17 02:27 +0000
Articles 16 — 8 participants

Back to article view | Back to comp.lang.javascript


Contents

  Can javascript work with mysqli? richard <noreply@example.com> - 2014-05-16 10:40 -0400
    Re: Can javascript work with mysqli? Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-16 19:25 +0200
      Re: Can javascript work with mysqli? richard <noreply@example.com> - 2014-05-16 15:29 -0400
        Re: Can javascript work with mysqli? Tim Streater <timstreater@greenbee.net> - 2014-05-16 23:06 +0100
        Re: Can javascript work with mysqli? Richard Damon <Richard@Damon-Family.org> - 2014-05-18 19:50 -0400
      Re: Can javascript work with mysqli? Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-16 21:56 +0200
        Re: Can javascript work with mysqli? Tim Streater <timstreater@greenbee.net> - 2014-05-16 23:08 +0100
          "javascript" (again) (was: Can javascript work with mysqli?) Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-17 00:31 +0200
            Re: "javascript" (again) Thomas 'PointedEars' Lahn <PointedEars@web.de> - 2014-05-17 10:36 +0200
            Re: "javascript" (again) richard <noreply@example.com> - 2014-05-17 14:02 -0400
              Re: "javascript" (again) Tim Streater <timstreater@greenbee.net> - 2014-05-17 19:14 +0100
      Re: Can javascript work with mysqli? John Harris <niam@jghnorth.org.uk.invalid> - 2014-05-17 16:05 +0100
        Re: Can javascript work with mysqli? Christoph Michael Becker <cmbecker69@arcor.de> - 2014-05-17 18:19 +0200
          Re: Can javascript work with mysqli? John Harris <niam@jghnorth.org.uk.invalid> - 2014-05-18 16:19 +0100
    Re: Can javascript work with mysqli? Good Guy <hello.world@example.com> - 2014-05-16 20:27 +0100
    Re: Can javascript work with mysqli? Denis McMahon <denismfmcmahon@gmail.com> - 2014-05-17 02:27 +0000

#24187 — Can javascript work with mysqli?

Fromrichard <noreply@example.com>
Date2014-05-16 10:40 -0400
SubjectCan javascript work with mysqli?
Message-ID<1epsqcvd9i0k0$.18wvjlyevd689.dlg@40tude.net>
If so how?
I need a way to track the plays of the songs on my site.
The script I am using now cycles through the list.
I need to update my database table when a song is being played.

[toc] | [next] | [standalone]


#24188

FromChristoph Michael Becker <cmbecker69@arcor.de>
Date2014-05-16 19:25 +0200
Message-ID<537649ef$0$6709$9b4e6d93@newsspool2.arcor-online.net>
In reply to#24187
richard wrote:

> If so how?
> I need a way to track the plays of the songs on my site.
> The script I am using now cycles through the list.
> I need to update my database table when a song is being played.

Reading your subject line in the strictest sense, the answer is "no",
because there is no javascript, see
<http://pointedears.de/scripts/test/es-matrix/#foreword>.

Reading your subject line case insensitive, the answer is "yes", see
e.g. <https://github.com/joyent/node/wiki/modules#db-mysql>.

Taking into account what I know about your site and what you want to
accomplish there, the answer is "not directly", but you can make
requests to your site from the client, see
<http://pointedears.de/scripts/faq/cljs/#runServerScript>.

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#24194

Fromrichard <noreply@example.com>
Date2014-05-16 15:29 -0400
Message-ID<1qzdbjbtaro5i$.18skp1f6r8e12.dlg@40tude.net>
In reply to#24188
On 16 May 2014 18:59:30 GMT, Stefan Ram wrote:

> Christoph Michael Becker <cmbecker69@arcor.de> writes:
>>there is no javascript
> 
>   »JavaScript« is a trademark of Oracle and the name of the
>   language that is interpreted by Java SE 8 by Oracle,
>   it is also the name of the language that is interpreted by
>   Firefox, where it is used with permission from Oracle.
> 
>   There is no mysqli AFAIK.

Then you should keep up with the times.
As of php 5.5 you are practtically forced to use mysqli.
That's been around at least a year if not more.

http://www.php.net/manual/en/book.mysqli.php

[toc] | [prev] | [next] | [standalone]


#24197

FromTim Streater <timstreater@greenbee.net>
Date2014-05-16 23:06 +0100
Message-ID<160520142306132526%timstreater@greenbee.net>
In reply to#24194
In article <1qzdbjbtaro5i$.18skp1f6r8e12.dlg@40tude.net>, richard
<noreply@example.com> wrote:

> On 16 May 2014 18:59:30 GMT, Stefan Ram wrote:
> 
> > Christoph Michael Becker <cmbecker69@arcor.de> writes:
> >>there is no javascript
> > 
> >   »JavaScript« is a trademark of Oracle and the name of the
> >   language that is interpreted by Java SE 8 by Oracle,
> >   it is also the name of the language that is interpreted by
> >   Firefox, where it is used with permission from Oracle.
> > 
> >   There is no mysqli AFAIK.
> 
> Then you should keep up with the times.
> As of php 5.5 you are practtically forced to use mysqli.
> That's been around at least a year if not more.
> 
> http://www.php.net/manual/en/book.mysqli.php

I thought you were talking about using it from javascript - see subject
line.

-- 
"The idea that Bill Gates has appeared like a knight in shining armour to
 lead all customers out of a mire of technological chaos neatly ignores 
 the fact that it was he who, by peddling second-rate technology, led them
 into it in the first place."                             - Douglas Adams

[toc] | [prev] | [next] | [standalone]


#24259

FromRichard Damon <Richard@Damon-Family.org>
Date2014-05-18 19:50 -0400
Message-ID<kHbev.1008234$ka5.212265@fx06.iad>
In reply to#24194
On 5/16/14, 3:29 PM, richard wrote:
> On 16 May 2014 18:59:30 GMT, Stefan Ram wrote:
> 
>> Christoph Michael Becker <cmbecker69@arcor.de> writes:
>>> there is no javascript
>>
>>   »JavaScript« is a trademark of Oracle and the name of the
>>   language that is interpreted by Java SE 8 by Oracle,
>>   it is also the name of the language that is interpreted by
>>   Firefox, where it is used with permission from Oracle.
>>
>>   There is no mysqli AFAIK.
> 
> Then you should keep up with the times.
> As of php 5.5 you are practtically forced to use mysqli.
> That's been around at least a year if not more.
> 
> http://www.php.net/manual/en/book.mysqli.php
> 

And perhaps you should read what it is exactly. mysqli is a *PHP*
interface to MySQL databases (versions 4.1 and later). By definition,
"javascript" can't talk to it (at least not directly) because
"javascript" is not PHP, and can't easily call any PHP functions.

A "javascript" program can communicate with a PHP program over an HTTP
link, but it shouldn't be communicating "mysqli" there, as that would
mean the PHP program was just "eval()"ing the data, which is "BAD".

[toc] | [prev] | [next] | [standalone]


#24196

FromChristoph Michael Becker <cmbecker69@arcor.de>
Date2014-05-16 21:56 +0200
Message-ID<53766d7f$0$6716$9b4e6d93@newsspool2.arcor-online.net>
In reply to#24188
Stefan Ram wrote:

> Christoph Michael Becker <cmbecker69@arcor.de> writes:
>> there is no javascript
> 
>   »JavaScript« is a trademark of Oracle and the name of the
>   language that is interpreted by Java SE 8 by Oracle,
>   it is also the name of the language that is interpreted by
>   Firefox, where it is used with permission from Oracle.

I am aware of that. :)

However, while I consider it good style to properly capitalize any name,
I am especially nitpicking about "javascript" (or "Javascript"), as it
is sometimes used as a general name for ECMAScript implementations and
sometimes used to mean JavaScript.  It occurs to me this sloppiness not
seldom is caused by lack of information regarding the areas of
applicability of ECMAScript implementations.  Many people think
JavaScript can only be used for browser side scripting (and also that it
is the only language available there), as can be seen in this thread.

It seems worth to point to the foreword of Thomas' ECMAScript matrix[1]
again.  Better be clear, than to cause confusion. :)

[1] <http://pointedears.de/scripts/test/es-matrix/#foreword>

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#24198

FromTim Streater <timstreater@greenbee.net>
Date2014-05-16 23:08 +0100
Message-ID<160520142308451648%timstreater@greenbee.net>
In reply to#24196
In article <53766d7f$0$6716$9b4e6d93@newsspool2.arcor-online.net>,
Christoph Michael Becker <cmbecker69@arcor.de> wrote:

> Stefan Ram wrote:
> 
> > Christoph Michael Becker <cmbecker69@arcor.de> writes:
> >> there is no javascript
> > 
> >   »JavaScript« is a trademark of Oracle and the name of the
> >   language that is interpreted by Java SE 8 by Oracle,
> >   it is also the name of the language that is interpreted by
> >   Firefox, where it is used with permission from Oracle.
> 
> I am aware of that. :)
> 
> However, while I consider it good style to properly capitalize any name,
> I am especially nitpicking about "javascript" (or "Javascript"), as it
> is sometimes used as a general name for ECMAScript implementations and
> sometimes used to mean JavaScript.  It occurs to me this sloppiness not
> seldom is caused by lack of information ...

No, I do it deliberately to annoy PointyHead. You'll note that I've
done the capitalisation there as, really speaking, that is two words.
Javascript, OTOH, is one word.

-- 
"Once you adopt the unix paradigm, the variants cease to be a problem - you
bitch, of course, but that's because bitching is fun, unlike M$ OS's, where 
bitching is required to keep your head from exploding." - S Stremler in afc

[toc] | [prev] | [next] | [standalone]


#24199 — "javascript" (again) (was: Can javascript work with mysqli?)

FromChristoph Michael Becker <cmbecker69@arcor.de>
Date2014-05-17 00:31 +0200
Subject"javascript" (again) (was: Can javascript work with mysqli?)
Message-ID<5376919e$0$6699$9b4e6d93@newsspool2.arcor-online.net>
In reply to#24198
Tim Streater wrote:

> In article <53766d7f$0$6716$9b4e6d93@newsspool2.arcor-online.net>,
> Christoph Michael Becker <cmbecker69@arcor.de> wrote:
> 
>> However, while I consider it good style to properly capitalize any name,
>> I am especially nitpicking about "javascript" (or "Javascript"), as it
>> is sometimes used as a general name for ECMAScript implementations and
>> sometimes used to mean JavaScript.  It occurs to me this sloppiness not
>> seldom is caused by lack of information ...
> 
> No, I do it deliberately to annoy PointyHead. 

Isn't that a bit silly a reason? :)

>                                               You'll note that I've
> done the capitalisation there as, really speaking, that is two words.
> Javascript, OTOH, is one word.

Okay, but many people write "php" or "html"--wouldn't that also be one
word?  I wonder how to pronounce it. ;)

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#24203 — Re: "javascript" (again)

FromThomas 'PointedEars' Lahn <PointedEars@web.de>
Date2014-05-17 10:36 +0200
SubjectRe: "javascript" (again)
Message-ID<3822304.VxIJy3VGhv@PointedEars.de>
In reply to#24199
Christoph Michael Becker wrote:

> Tim Streater wrote:
>> Christoph Michael Becker <cmbecker69@arcor.de> wrote:
>>> However, while I consider it good style to properly capitalize any name,
>>> I am especially nitpicking about "javascript" (or "Javascript"), as it
>>> is sometimes used as a general name for ECMAScript implementations and
>>> sometimes used to mean JavaScript.  It occurs to me this sloppiness not
>>> seldom is caused by lack of information ...
>> 
>> No, I do it deliberately to annoy PointyHead.
> 
> Isn't that a bit silly a reason? :)

  There is no offense where none is taken. 
    ─Surak

-- 
PointedEars
FAQ: <http://PointedEars.de/faq> | SVN: <http://PointedEars.de/wsvn/>
Twitter: @PointedEars2 | ES Matrix: <http://PointedEars.de/es-matrix>
Please do not Cc: me. / Bitte keine Kopien per E-Mail.

[toc] | [prev] | [next] | [standalone]


#24207 — Re: "javascript" (again)

Fromrichard <noreply@example.com>
Date2014-05-17 14:02 -0400
SubjectRe: "javascript" (again)
Message-ID<h956ffwjd01l.4fummz2lnop0$.dlg@40tude.net>
In reply to#24199
On Sat, 17 May 2014 00:31:04 +0200, Christoph Michael Becker wrote:

> Tim Streater wrote:
> 
>> In article <53766d7f$0$6716$9b4e6d93@newsspool2.arcor-online.net>,
>> Christoph Michael Becker <cmbecker69@arcor.de> wrote:
>> 
>>> However, while I consider it good style to properly capitalize any name,
>>> I am especially nitpicking about "javascript" (or "Javascript"), as it
>>> is sometimes used as a general name for ECMAScript implementations and
>>> sometimes used to mean JavaScript.  It occurs to me this sloppiness not
>>> seldom is caused by lack of information ...
>> 
>> No, I do it deliberately to annoy PointyHead. 
> 
> Isn't that a bit silly a reason? :)
> 
>>                                               You'll note that I've
>> done the capitalisation there as, really speaking, that is two words.
>> Javascript, OTOH, is one word.
> 
> Okay, but many people write "php" or "html"--wouldn't that also be one
> word?  I wonder how to pronounce it. ;)

I think it's damn silly and ignorant to argue over whether or not the name
of a language should be "properly" punctuated.
"javascript", without caps, is commonly used and is commonly accepted to
mean javascript which was originally developed by Netscape.
Like when I say DOS, do I mean DoS, dos, or MSDow?
When speaking of PHP or HTML, do I eamn the languange or file extension?
Should the file extension be all caps or all lowercase?
Who the fuck cares?

When I see some asswipe arguing over "proper" spelling, to me, that asswipe
is just arguing because he's the guy who has to show off that he really is
an asswipe.

Like it used to be you'd get flamed for using "your" and "you're"
improperly. It's instead of its.

[toc] | [prev] | [next] | [standalone]


#24208 — Re: "javascript" (again)

FromTim Streater <timstreater@greenbee.net>
Date2014-05-17 19:14 +0100
SubjectRe: "javascript" (again)
Message-ID<170520141914423103%timstreater@greenbee.net>
In reply to#24207
In article <h956ffwjd01l.4fummz2lnop0$.dlg@40tude.net>, richard
<noreply@example.com> wrote:

> Like it used to be you'd get flamed for using "your" and "you're"
> improperly. It's instead of its.

<stern look>And you still do, young richard, so just watch it.</>

-- 
"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#24205

FromJohn Harris <niam@jghnorth.org.uk.invalid>
Date2014-05-17 16:05 +0100
Message-ID<iluen9pilg2rka6fvls7ji51ukbqvte6dh@4ax.com>
In reply to#24188
On Fri, 16 May 2014 19:25:13 +0200, Christoph Michael Becker
<cmbecker69@arcor.de> wrote:

>richard wrote:
>
>> If so how?
>> I need a way to track the plays of the songs on my site.
>> The script I am using now cycles through the list.
>> I need to update my database table when a song is being played.
>
>Reading your subject line in the strictest sense, the answer is "no",
>because there is no javascript, see
><http://pointedears.de/scripts/test/es-matrix/#foreword>.
  <snip>

That foreword is a biased, and frankly rather silly, example of a
strawman argument : "Some people talk about ... . They are WRONG!".

Well, yes, but it isn't what most people are saying. They aren't using
"javascript" to mean there is only one language.

  John

[toc] | [prev] | [next] | [standalone]


#24206

FromChristoph Michael Becker <cmbecker69@arcor.de>
Date2014-05-17 18:19 +0200
Message-ID<53778c15$0$6657$9b4e6d93@newsspool3.arcor-online.net>
In reply to#24205
John Harris wrote:

> On Fri, 16 May 2014 19:25:13 +0200, Christoph Michael Becker
> <cmbecker69@arcor.de> wrote:
> 
>> richard wrote:
>>
>>> If so how?
>>> I need a way to track the plays of the songs on my site.
>>> The script I am using now cycles through the list.
>>> I need to update my database table when a song is being played.
>>
>> Reading your subject line in the strictest sense, the answer is "no",
>> because there is no javascript, see
>> <http://pointedears.de/scripts/test/es-matrix/#foreword>.
>   <snip>
> 
> That foreword is a biased, and frankly rather silly, example of a
> strawman argument : "Some people talk about ... . They are WRONG!".
> 
> Well, yes, but it isn't what most people are saying. They aren't using
> "javascript" to mean there is only one language.

Isn't it a fallacy, when you cite the foreword saying "*some* people are
wrong" and argue that "*most* people are right", so the foreword is a
biased strawman argument?

Anyway, I'm not really concerned about "most people" here, but about the
others who don't know what "javascript" really is and where it can be
applied.  Apparently, the OP is assuming that there is some language
called "javascript" built into browsers (most likely assuming that
window, document etc. are parts of this language).  When I started
reading this newsgroup, I also assumed that.  If it wasn't for Thomas
and a few others in this group pointing out that is not the case
(without going into detail, so an interested reader was made aware of
the issue, being able to investigate further himself), it is not
unlikely, that I still would think so.  And most likely I still would
use jQuery to do browser side scripting, which hides all these details,
and with them a lot of important concepts.

I think others deserve the same chance that I've got.  Therefore I
posted not only what you have quoted, but also what you have
deliberously snipped...

-- 
Christoph M. Becker

[toc] | [prev] | [next] | [standalone]


#24226

FromJohn Harris <niam@jghnorth.org.uk.invalid>
Date2014-05-18 16:19 +0100
Message-ID<mpjhn99q3bsh4h4grthfjv3e75k77bj69o@4ax.com>
In reply to#24206
On Sat, 17 May 2014 18:19:44 +0200, Christoph Michael Becker
<cmbecker69@arcor.de> wrote:

>John Harris wrote:
>
>> On Fri, 16 May 2014 19:25:13 +0200, Christoph Michael Becker
>> <cmbecker69@arcor.de> wrote:
>> 
>>> richard wrote:
>>>
>>>> If so how?
>>>> I need a way to track the plays of the songs on my site.
>>>> The script I am using now cycles through the list.
>>>> I need to update my database table when a song is being played.
>>>
>>> Reading your subject line in the strictest sense, the answer is "no",
>>> because there is no javascript, see
>>> <http://pointedears.de/scripts/test/es-matrix/#foreword>.
>>   <snip>
>> 
>> That foreword is a biased, and frankly rather silly, example of a
>> strawman argument : "Some people talk about ... . They are WRONG!".
>> 
>> Well, yes, but it isn't what most people are saying. They aren't using
>> "javascript" to mean there is only one language.
>
>Isn't it a fallacy, when you cite the foreword saying "*some* people are
>wrong" and argue that "*most* people are right", so the foreword is a
>biased strawman argument?

It would be a fallacy if that were what I wrote. But I didn't. I said
that it's what most people are saying. Whether they are "right",
whatever that may mean, is a matter for discussion, a discussion that
Thomas refuses to allow.


>Anyway, I'm not really concerned about "most people" here, but about the
>others who don't know what "javascript" really is and where it can be
>applied.  Apparently, the OP is assuming that there is some language
>called "javascript" built into browsers (most likely assuming that
>window, document etc. are parts of this language).  

I don't think the OP's subject implies any such assumption. At least,
to a native English speaker it doesn't.


>When I started
>reading this newsgroup, I also assumed that.  If it wasn't for Thomas
>and a few others in this group pointing out that is not the case
>(without going into detail, so an interested reader was made aware of
>the issue, being able to investigate further himself), it is not
>unlikely, that I still would think so.  And most likely I still would
>use jQuery to do browser side scripting, which hides all these details,
>and with them a lot of important concepts.

And did you get a slap in the face : "javascript does not exist!". And
did you then believe that the word cannot possibly have a different
meaning? If so then you were taught by a bad teacher.


>I think others deserve the same chance that I've got.  Therefore I
>posted not only what you have quoted, but also what you have
>deliberously snipped...

Have you never wondered if it's possible to talk about a "vehicle"
when really there are only cars and buses and lorries and motorbikes
and ... .

  John

[toc] | [prev] | [next] | [standalone]


#24193

FromGood Guy <hello.world@example.com>
Date2014-05-16 20:27 +0100
Message-ID<ll5or1$9rr$2@speranza.aioe.org>
In reply to#24187
On 16/05/2014 15:40, richard wrote:
> If so how?
> I need a way to track the plays of the songs on my site.
> The script I am using now cycles through the list.
> I need to update my database table when a song is being played.
> 


MySQLi and MySQL works best with PHP.  Javascript is not meant to
interface with databases AFAIK but I might be wrong like many things
here :(.

[toc] | [prev] | [next] | [standalone]


#24201

FromDenis McMahon <denismfmcmahon@gmail.com>
Date2014-05-17 02:27 +0000
Message-ID<ll6hec$u5v$2@dont-email.me>
In reply to#24187
On Fri, 16 May 2014 10:40:58 -0400, richard wrote:

"mysqli" in the sense of your question is presumably the class 
implemented in php to allow php to interface with mysql databases and is 
thus "server side functionality" in the client - server model of www 
transactions. It is further presumed that your reference to mysqli in 
fact means php code incorporating the mysqli class running on a web 
server and responding to requests from a web browser.

"javascript" in the sense of your question is presumably the scripting 
language implemented in modern web browsers and is thus "client side 
functionality" in the client - server model of www transactions. It is 
further presumed that your reference to javascript in fact means 
javascript code running inside the web browser referenced above and 
making requests to and receiving responses from the web server referenced 
above.

"work with" in the sense of your question is presumed to indicate the 
ability for javascript (as defined above) to access or change data within 
a mysql database using php scripts running on a web server using mysqli 
(as defined above).

I believe it has been explained to you in the past that for client side 
functionality to communicate with server side functionality, the client 
side functionality has to make some sort of request to the server and 
handle the server response to that request. Such requests when 
implemented between web browsers and web servers are commonly referred to 
as AJAX requests.

Commonly the mechanism by which what I believe you seek to achieve would 
be accomplished is that the javascript code in the web browser needs to 
make an AJAX request to the web server which results in a mysqli database 
transaction being triggered at the web server.

-- 
Denis McMahon, denismfmcmahon@gmail.com

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.javascript


csiph-web