PHP

Moderators: None (Apply to moderate this forum)
Number of threads: 1845
Number of posts: 5013

This Forum Only
Post New Thread
Single Post View       Linear View       Threaded View      f

Report
database help Posted by Development on 2 Nov 2003 at 10:16 AM
ok I updated the code but it still dont show the users first name
code below:

<?PHP
include("../config.php");
mysql_select_db($database) ;
mysql_query("firstname='$firstname1' WHERE firstname='$firstname1'") ;
?>

can u fix it? or give me a better example
Slewis
Report
Re: database help Posted by Jonathan on 2 Nov 2003 at 11:34 AM
: mysql_query("firstname='$firstname1' WHERE firstname='$firstname1'");
Well that ain't going to work. You need to put a VALID SQL QUERY there, like I think DarQ has been trying to tell you. If you don't know SQL haul your butt over to http://www.sqlcourse.com/ - it's not hard to learn and that site will have you up and running with it pretty quick.

The proccess of querying for the data and assigning it to variables are seperate. You need to write a query that states what data you want. That query is then executed, as per DarQ's example, then you write seperate commands to assign the data returned to the variables you want it in.

Just trying to clarify by explaining it another way. See DarQ's post for PHP examples, 'cus they are correct.

Jonathan

###
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Report
Re: database help Posted by Development on 2 Nov 2003 at 11:56 AM
OK OK so I put a none right click on my site dam it my page I can do what I like stop going on @ me


: : mysql_query("firstname='$firstname1' WHERE firstname='$firstname1'");
: Well that ain't going to work. You need to put a VALID SQL QUERY there, like I think DarQ has been trying to tell you. If you don't know SQL haul your butt over to http://www.sqlcourse.com/ - it's not hard to learn and that site will have you up and running with it pretty quick.
:
: The proccess of querying for the data and assigning it to variables are seperate. You need to write a query that states what data you want. That query is then executed, as per DarQ's example, then you write seperate commands to assign the data returned to the variables you want it in.
:
: Just trying to clarify by explaining it another way. See DarQ's post for PHP examples, 'cus they are correct.
:
: Jonathan
:
: ###
: for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
: (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
: /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
:
:

Slewis

Report
Re: database help Posted by Jonathan on 2 Nov 2003 at 12:22 PM
: OK OK so I put a none right click on my site dam it my page I can do
: what I like stop going on @ me9
WTF???!!! That was in the OTHER thread. In this one I was trying to recommend a place where you can learn SQL. *sighs*

:
:
: : : mysql_query("firstname='$firstname1' WHERE firstname='$firstname1'");
: : Well that ain't going to work. You need to put a VALID SQL QUERY there, like I think DarQ has been trying to tell you. If you don't know SQL haul your butt over to http://www.sqlcourse.com/ - it's not hard to learn and that site will have you up and running with it pretty quick.
: :
: : The proccess of querying for the data and assigning it to variables are seperate. You need to write a query that states what data you want. That query is then executed, as per DarQ's example, then you write seperate commands to assign the data returned to the variables you want it in.
: :
: : Just trying to clarify by explaining it another way. See DarQ's post for PHP examples, 'cus they are correct.
: :
: : Jonathan
: :
: : ###
: : for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
: : (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
: : /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
: :
: :
:
: Slewis
:
:


###
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Report
Re: database help Posted by Development on 2 Nov 2003 at 12:35 PM
ok that site I am lot @ dont even no were to look at lol

I played around more with code

<?PHP
include("../config.php");
mysql_select_db('fantaziachat') ;
$result = mysql_query("SELECT * FROM 'ALS_signup' WHERE firstname='$firstname1'") ;
?>

but still dont know ummm maybe easy for u but not for me :(
Slewis

Report
Re: database help Posted by Development on 2 Nov 2003 at 12:56 PM
OK I think I working it out slowly check this tel me whats worng

<?PHP
include("../config.php");
mysql_select_db('fantaziachat') ;
$queryresult = mysql_query("SELECT * WHERE ALS_signup") ;
while ($fetchresult = mysql_fetch_array($queryresult)) {
$username1 = $fetchresult['username'];
}
?>

is that how it works?
Slewis

Report
Re: database help Posted by Development on 2 Nov 2003 at 1:37 PM
Ok I work it out @ last but I can not get it to put the text in the textbox it only shows on the page its self

code:

<?PHP
$reqlevel = 1;
include("membersonly.inc.php");
include("../config.php");
$dbh = mysql_connect($server, $username, $password) or die("Unable to connect to MySQL");
$selected = mysql_select_db("fantaziachat",$dbh) or die("Could not find database table");
$result = mysql_query("SELECT firstname,lastname FROM ALS_signup");
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
print " Name:".$row{'firstname'}." ".$row{'lastname'}."<br>";
{my code that I tryed to make it add to textbox}
print $firstname1['firstname'];
}
mysql_close($dbh);
?>

textbox code:

<td width="191"><input name="first" type="text" value="<?php $firstname1; ?>" size=16 maxlength=32></td>
Slewis

Report
Re: database help Posted by Jonathan on 2 Nov 2003 at 2:05 PM
: while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
: print " Name:".$row{'firstname'}." ".$row{'lastname'}."";
: {my code that I tryed to make it add to textbox}
: print $firstname1['firstname'];
Should that not be print $row{'firstname'};

: <td width="191"><input name="first" type="text" value="<?php
: $firstname1; ?>" size=16 maxlength=32></td>
And same there, replace $firstname with $row{'firstname'}

Jonathan

###
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Report
Re: database help Posted by DarQ on 2 Nov 2003 at 2:28 PM
what? do i see progress here??? come on developer and you'll mess around with it all u want in a month !!

: : while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
: : print " Name:".$row{'firstname'}." ".$row{'lastname'}."";
: : {my code that I tryed to make it add to textbox}
: : print $firstname1['firstname'];
: Should that not be print $row{'firstname'};
:
: : <td width="191"><input name="first" type="text" value="<?php
: : $firstname1; ?>" size=16 maxlength=32></td>
: And same there, replace $firstname with $row{'firstname'}
:
: Jonathan
:
: ###
: for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
: (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
: /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
:
:

DarQ
url--> http://mark.space.servehttp.com

Report
Re: database help Posted by Jonathan on 2 Nov 2003 at 2:36 PM
: what? do i see progress here??? come on developer and you'll mess
: around with it all u want in a month !!
It's easy when you know how... When you go to university to do a computer science course and then you have to do maths and physics also in your first year, you quickly learn what it's like not to understand stuff. Special relativity, folks?

Jonathan

###
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");

Report
Re: database help Posted by DarQ on 2 Nov 2003 at 2:45 PM
: : what? do i see progress here??? come on developer and you'll mess
: : around with it all u want in a month !!
: It's easy when you know how... When you go to university to do a computer science course and then you have to do maths and physics also in your first year, you quickly learn what it's like not to understand stuff. Special relativity, folks?
oh yes i know how difficult things can be. but in this case... RTFM and use google... we still cant upload knowledge into our brains, yet
:
: Jonathan
:
: ###
: for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
: (tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
: /(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");
:
:

DarQ
url--> http://mark.space.servehttp.com

Report
Re: database help Posted by Development on 2 Nov 2003 at 2:37 PM
OK I have the following :

<?PHP
$reqlevel = 1;
include("membersonly.inc.php");
include("../config.php");
$dbh = mysql_connect($server, $username, $password) or die("Unable to connect to MySQL");
$selected = mysql_select_db("fantaziachat",$dbh) or die("Could not find database table");
$result = mysql_query("SELECT firstname, lastname, mailadres, wphone, hphone, address, city, province, postcode, m, d, y, sex FROM ALS_signup");
while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
$row{'firstname'};
}
mysql_close($dbh);
?>

field code:

<td width="191"><input name="first" type="text" value="<?php $row{'firstname'}; ?>" size=16 maxlength=32></td>

and it still dont show up in field :(
Slewis

Report
Re: database help Posted by Jonathan on 2 Nov 2003 at 2:48 PM
: OK I have the following :
:
: <?PHP
: $reqlevel = 1;
: include("membersonly.inc.php");
: include("../config.php");
: $dbh = mysql_connect($server, $username, $password) or die("Unable to connect to MySQL");
: $selected = mysql_select_db("fantaziachat",$dbh) or die("Could not find database table");
: $result = mysql_query("SELECT firstname, lastname, mailadres, wphone, hphone, address, city, province, postcode, m, d, y, sex FROM ALS_signup");
: while ($row = mysql_fetch_array($result,MYSQL_ASSOC)) {
: $row{'firstname'};
Here do:-
$firstname = $row{'firstname'};
Instead.

: field code:
:
: <td width="191"><input name="first" type="text" value="<?php $row
: {'firstname'}; ?>" size=16 maxlength=32></td>
:
: and it still dont show up in field :(
My guess is that the above is outside of your while loop, in which case it probably won't work. I don't know how PHP scopes variables etc. But now you can just replace $row{'firstname'} with $firstname, e.g.

<td width="191"><input name="first" type="text" value="<?php $firstname; ?>" size=16 maxlength=32></td>

Jonathan

###
for(74,117,115,116){$::a.=chr};(($_.='qwertyui')&&
(tr/yuiqwert/her anot/))for($::b);for($::c){$_.=$^X;
/(p.{2}l)/;$_=$1}$::b=~/(..)$/;print("$::a$::b $::c hack$1.");




 

Recent Jobs

Official Programmer's Heaven Blogs
Web Hosting | Browser and Social Games | Gadgets

Popular resources on Programmersheaven.com
Assembly | Basic | C | C# | C++ | Delphi | Flash | Java | JavaScript | Pascal | Perl | PHP | Python | Ruby | Visual Basic
© Copyright 2011 Programmersheaven.com - All rights reserved.
Reproduction in whole or in part, in any form or medium without express written permission is prohibited.
Violators of this policy may be subject to legal action. Please read our Terms Of Use and Privacy Statement for more information.
Operated by CommunityHeaven, a BootstrapLabs company.