Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

database help

DevelopmentDevelopment Posts: 222Member
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
«1

Comments

  • JonathanJonathan Posts: 2,914Member
    : 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.");

  • DevelopmentDevelopment Posts: 222Member
    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

  • JonathanJonathan Posts: 2,914Member
    : 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.");

  • DevelopmentDevelopment Posts: 222Member
    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

  • DevelopmentDevelopment Posts: 222Member
    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

  • DevelopmentDevelopment Posts: 222Member
    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:

    " size=16 maxlength=32>
    Slewis

  • JonathanJonathan Posts: 2,914Member
    : 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'};

    : " size=16 maxlength=32>
    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.");

  • DarQDarQ Posts: 1,625Member
    what? do i see progress here??? come on developer and you'll mess around with it all u want in a month !! :-D

    : : 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'};
    :
    : : " size=16 maxlength=32>
    : 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.");
    :
    :

    [size=5][italic][blue]Dar[RED]Q[/RED][/blue][/italic][/size]
    url--> http://mark.space.servehttp.com

  • JonathanJonathan Posts: 2,914Member
    : what? do i see progress here??? come on developer and you'll mess
    : around with it all u want in a month !! :-D
    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.");

  • DevelopmentDevelopment Posts: 222Member
    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:

    " size=16 maxlength=32>

    and it still dont show up in field :(
    Slewis

«1
Sign In or Register to comment.