How do I AJAX last data

0 favourites
From the Asset Store
Data+ is the best Data Management solution for Construct 3. It contains 4 Addons (Plugin & Behavior).
  • hi <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" />

    i have problem, because i want to create project like in this tutorial

    scirra.com/tutorials/525/si ... l-database

    this is my results (images)

    for more info <img src="{SMILIES_PATH}/icon_e_smile.gif" alt=":)" title="Smile" /> tell me in reply

    help plzzzz i'm trying to solve this mystery

    ps. ohh sorry i forggot show the script

    <?php
    $username = $_GET['fname'];
    $password = $_GET['fpass'];
    $con=mysqli_connect("mysql","construct2_nowy","construct2_lol","construct2");
    // Check connection
    if (mysqli_connect_errno())
      {
      echo "Failed to connect to MySQL: " . mysqli_connect_error();
      }
    $qz = str_replace("\'","",$qz);
    $result = mysqli_query($con,$qz);
    while($row = mysqli_fetch_array($result))
      {
      echo $row['id'];
      }
    mysqli_close($con);
    ?>
    [/code:2uijvt8d]
  • Hi kodisz I'll try to help you.

    Are you able to identify where it breaks down?

  • P.S. It's not normally a good idea to show your passwords in a forum post - replace them with *******

  • this is invented password for test in example.... in polish this is "ass12" :d huhuhu

    when i click login this is results like on debug... on id variable "NaN"

    but when i add in line 1 like on tutorial

    <?php header('Access-Control-Allow-Origin: *');
    [/code:15zoxn6d]
    
    i have such results
    
    ps. nieznany = unknown
  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • NaN means "not a number"

    To deal with one problem at a time it might be easier for you just to run the php script directly in your url on a browser. You'll get the same error messages but they should be easier to read.

  • I see you're using xampp - try localhost instead of mysql in this line...

    $con=mysqli_connect("mysql","construct2_nowy","construct2_lol","construct2");

  • ;cc not working

    to make sure

    $con=mysqli_connect("localhost","construct2_nowy","construct2_lol","construct2");

    ????

    on image results of open script in browser

  • Th notices are because you need to put these into the url....

    login.php?fname=kodisz&fpass=ass12

  • ohh sorry hahahha like a idiot ;D

  • Did you actually set up the database? You can check via phpmyadmin with xampp.

  • maybe you have right

    this is my database

    tell me what you want to see ?

  • Is good. I'll just fire mine up so I can see where things are (in English) lol

  • Okay. We need to work through those error messages. Always deal with the first one...

    It still doesn't like host - that's the bit we changed from mysql to localhost - in my English version I always have to use localhost but yours didn't like either.

    Can you do Google it in Polish to see what you should call the host for a database connection via xampp?

  • yea ;D i found

  • Did you find what to use instead of localhost?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)