Kniggles's Recent Forum Activity

  • Not sure what exactly your stuck on...

    If it is the php part; post_['name'] doesn't look correct. Try $_POST["name"]

    If that isn't the problem then:

    1. Can you output textbox1.text somewhere to see it is getting the correct text?, you'll need to url encode it so that it doesn't cause problem with spaces and special characters!

    2. Can you post the php you have so far if the problem is there?

    Hi IndieKiwi, Thanks for helping,

    Heres the php ,

    <?php
    header('Access-Control-Allow-Origin: *');
    
    $host="mysite.com/ect"; // Host name 
    $username="username1"; // Mysql username 
    $password="passwordtest"; // Mysql password 
    $db_name="dbname1"; // Database name 
    $tbl_name="table1"; // Table name
    
    $name = mysqli_real_escape_string($con, $_POST['name']); 
    
    // Connect to server and select database.
    mysql_connect("$host", "$username", "$password")or die("cannot connect"); 
    mysql_select_db("$db_name")or die("cannot select DB");
    
    // Retrieve data from database 
    $sql="SELECT * FROM pits WHERE name='$name' ";
    $result=mysql_query($sql);
    
    // Start looping rows in mysql database.
    while($rows=mysql_fetch_array($result)){
    echo $rows['name'] . "|" . $rows['info1'] . "|". $rows['info2'] . "|";
    
    // close while loop 
    }
    
    // close MySQL connection 
    mysql_close();
    ?>[/code:2t4wk5eg]
    When I change this
    [code:2t4wk5eg]$sql="SELECT * FROM pits WHERE name='$name' ";[/code:2t4wk5eg]
    to this
    [code:2t4wk5eg] $sql="SELECT * FROM pits ";[/code
    I get all the data from the base back 
    
    and when i change to 
    [code]$sql="SELECT * FROM pits WHERE name='bob' ";[/code:2t4wk5eg]
    I get bob's data back ,
    
    this leads me to believe that I have screwed up the Construct2 line.
  • how did the pixel become the color to make the sound ?

  • [attachment=0:3lsg8pe6][/attachment:3lsg8pe6]Hi all,

    I am trying to use Ajax to get some data out of the base.

    The bit i am stuck on is in Construct2 where the url to request is

    "http://mysite.com/myphps/getdata.php?name="&textbox1.text [/code:3lsg8pe6]
    
    the result i am looking to compute is 
    $name=post_['name']
    Data from base WHERE name =$name.
    
    All the videos i have seen so far don't have the a variable to play with and I am running out of ideas.
    thanks.
  • You don't include the values as part of the URL in a POST request. Put them in the data field: [attachment=0:3lpi8ui2][/attachment:3lpi8ui2]

    Not Only is that a lot simpler it also works

    thank you very much " ramones "

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Hi I am trying to work out how to use Ajax and I am stuck on the POST side of the line for Construct2

    the lane I have is,

    "http://mywebsite.com/ajaxTrain/postIn.php?Username="& Username.Text &"&Password=" & Password.Text[/code:2yb1rme8]
    
    the Ajax"on completed" action gets triggered how ever when i look into the base there's nothing there.
    I have also echoed out the data to another part of the screen that is being sent to the .php 
    after the Ajax is called and that computes right,
    

    this is the .php

    $Username = mysqli_real_escape_string($con, $_POST['Username']);
    $Password = mysqli_real_escape_string($con, $_POST['Password']);
    
    $sql="INSERT INTO members (username, password)VALUES ('$Username', '$Password')";
    [/code:2yb1rme8]
  • Hi I am trying to work out how to use Ajax and I am stuck on the POST side of the line for Construct2

    the lane I have is,

    "http://mywebsite.com/ajaxTrain/postIn.php?Username="& Username.Text &"&Password=" & Password.Text[/code:220cf9c5]
    
    the Ajax"on completed" action gets triggered how ever when i look into the base there's nothing there.
    I have also echoed out the data to another part of the screen that is being sent to the .php 
    after the Ajax is called and that computes right,
  • I have not had this problem before, we think now it maybe something to do with the hosting company and cache on their side.

    Said they were going to turn it off.

    This fixed it.

    thanks every one.

  • I have not had this problem before, we think now it maybe something to do with the hosting company and cache on their side.

    Said they were going to turn it off.

  • I never export my games to the same folder twice. At least, I delete the export content and do it all over again... and so should you, I think.

    I have done this and still the 1st exported copy gets exported,

    I have closed and rebooted the programs, even deleted folders off the server and reloaded with the new folder, still the same,

    I have open the index.html of the exported in notepad and copied that into a server file and the same result, this leads me to believe that the error is in construct2 source not exporting/overwriting the changes ,

    I have installed 173 again and running that from a flash drive and the same is still happening.

  • Hi , Is anyone else finding that when you make changes to a project that when you export it to the same destination it duz not over write ?

    I have also tried exporting it to a new folder and still the old files get exported.

    I am using 177 beta.

  • Right click the event, and select the "or" button

    Thanks i can see it now was looking for just 'or'

  • Hi,

    I am trying to follow a tut and have come up with an "or" and do not know ,and cant yet work out how to make it appear in my demo,

    can anyone show me how to get it please ?

Kniggles's avatar

Kniggles

Member since 2 Dec, 2013

None one is following Kniggles yet!

Connect with Kniggles

Trophy Case

  • 10-Year Club
  • RTFM Read the fabulous manual
  • Email Verified

Progress

12/44
How to earn trophies