PHP + MySQL  
Author Message
Jari





PostPosted: 2004-3-2 22:55:03 Top

php-general, PHP + MySQL if i do this:
mysql_query("SELECT id,game,release, from nexus order by release ASC");

it will print a table like this:

id game release
6 gangland 04.03.2004
7 sacred 23.03.2004
8 far cry 23.03.2004


So it orders them by date and by ID...

tried something like withouth success ('coz i'm a newb)
mysql_query("SELECT id,game,release, from nexus order by release ASC AND
order by game ASC");");

How can i get far cry to be before sacred (alphabetically)??

Thanks in advance ;)

-jK-



 
Martin Buchleitner





PostPosted: 2004-3-2 22:59:00 Top

php-general >> PHP + MySQL * "Jari" <email***@***.com> wrote:

> if i do this:
> mysql_query("SELECT id,game,release, from nexus order by release ASC");
>
> it will print a table like this:
>
> id game release
> 6 gangland 04.03.2004
> 7 sacred 23.03.2004
> 8 far cry 23.03.2004
>
>
> So it orders them by date and by ID...
>
> tried something like withouth success ('coz i'm a newb)
> mysql_query("SELECT id,game,release, from nexus order by release ASC AND
> order by game ASC");");

SELECT id,game,release FROM nexus ORDER BY release ASC, game ASC;


Download mysqlcc [1] and play there with SQL-Statements.


HTH, mabu


Footnote(s):
[1] <URL: http://www.mysql.com/downloads/mysqlcc.html>

--
Are you Anonymous? Where? ... I don't think so ...

[ devnull{at}chaosfactory{dot}org | http://www.chaosfactory.org/ ]
 
Jari





PostPosted: 2004-3-3 1:33:00 Top

php-general >> PHP + MySQL > SELECT id,game,release FROM nexus ORDER BY release ASC, game ASC;
>
>
> Download mysqlcc [1] and play there with SQL-Statements.
>
>
> HTH, mabu
>
>
> Footnote(s):
> [1] <URL: http://www.mysql.com/downloads/mysqlcc.html>
>
> --
> Are you Anonymous? Where? ... I don't think so ...
>
> [ devnull{at}chaosfactory{dot}org | http://www.chaosfactory.org/ ]



Almost too simple.. Thanks ;)


 
 
Jean Luc Guislain





PostPosted: 2004-4-8 12:21:00 Top

php-general >> PHP + MySQL Can anyone help Jayhel?

When I create a form with name and password and action it to another form
with keyword search in mySQL it connects to mysql when the second form is
called :
$linkID = mysql_connect("localhost","$userName","$secretWord"); OK!
but...
the variable coming from the first form (name and password) are lost the
first time I make a "send data" in the second form which actions to itself.
How could I go around this without having to use <input name hidden>.
I want to pass the name and password permanently from the first form to the
second form.

Tks in advance,

Jayhel
Jean Luc Guislain
Montreal
 
 
Jean Luc Guislain





PostPosted: 2004-4-8 12:34:00 Top

php-general >> PHP + MySQL Can anyone help Jayhel?

When I create a form with name and password and action it to another form
with keyword search in mySQL it connects to mysql when the second form is
called :
$linkID = mysql_connect("localhost","$userName","$secretWord"); OK!
but...
the variable coming from the first form (name and password) are lost the
first time I make a "send data" in the second form which actions to itself.
How could I go around this without having to use <input name hidden>.
I want to pass the name and password permanently from the first form to the
second form.

Tks in advance,

Jayhel
Jean Luc Guislain
Montreal
 
 
Thibaut





PostPosted: 2004-4-8 15:56:00 Top

php-general >> PHP + MySQL Salut Jean Luc.

I think it is not a good thing to include password from form to form.
Why don't you simply register this information in user's session ?

session_start();
$usrname="toto";
$passwrd="flyairbus!"
session_register("usrname","passwrd")

so it will be available in $_SESSION array

Bonne journé–‘

thibaut

Jean Luc Guislain wrote:
> Can anyone help Jayhel?
>
> When I create a form with name and password and action it to another form
> with keyword search in mySQL it connects to mysql when the second form is
> called :
> $linkID = mysql_connect("localhost","$userName","$secretWord"); OK!
> but...
> the variable coming from the first form (name and password) are lost the
> first time I make a "send data" in the second form which actions to itself.
> How could I go around this without having to use <input name hidden>.
> I want to pass the name and password permanently from the first form to the
> second form.
>
> Tks in advance,
>
> Jayhel
> Jean Luc Guislain
> Montreal
 
 
Ike





PostPosted: 2004-4-8 22:47:00 Top

php-general >> PHP + MySQL Typically, you write a cookie to the local machine, and an entry into th
MySQL database for that user. Any suybsequent pages, the two are compared.
THis way, you arent passing passwords around.

Go to a scripts library and look up signon scripts. THere are many about
that do just this -Ike

"Jean Luc Guislain" <email***@***.com> wrote in message
news:QD4dc.162044$email***@***.com...
> Can anyone help Jayhel?
>
> When I create a form with name and password and action it to another form
> with keyword search in mySQL it connects to mysql when the second form is
> called :
> $linkID = mysql_connect("localhost","$userName","$secretWord"); OK!
> but...
> the variable coming from the first form (name and password) are lost the
> first time I make a "send data" in the second form which actions to
itself.
> How could I go around this without having to use <input name hidden>.
> I want to pass the name and password permanently from the first form to
the
> second form.
>
> Tks in advance,
>
> Jayhel
> Jean Luc Guislain
> Montreal


 
 
Colin McKinnon





PostPosted: 2004-4-9 5:18:00 Top

php-general >> PHP + MySQL Jean Luc Guislain spilled the following:

> the variable coming from the first form (name and password) are lost the
> first time I make a "send data" in the second form which actions to
> itself. How could I go around this without having to use <input name
> hidden>. I want to pass the name and password permanently from the first
> form to the second form.
>

Easiest solution would be to use session variables. Alternatively, if you
just don't want the username/password boucing back and forth with each page
in plaintext use encyption - e.g. mcrypt, using 3DES.

HTH

C.
 
 
phpdrm





PostPosted: 2007-7-19 4:18:00 Top

php-general >> PHP + MySQL I just can't figure it out and Google yielded no help. I have a table named
'settings' which contains two fields, 'item' and 'content'. What I would
like to do is grab that data and use the 'item' field as the name, and use
the respective 'content' as the value in an array. For Example:

Array (
copyright => Copyright 2007 yada yada
version = > 2.15.1
)

That way I can do <?= $settings['version'] ?>

Can you help point me in the right direction? Any help would be greatly
appreciated!! :-D

--
-Dan