AnD4D's Recent Forum Activity

  • Nice one sizcoz !

    Quick question. Why do you have &"" at the end? I haven't tested it, but I was told by a friend today that if I replaced intval with spritef it would then work.

    Interesting that there are so many ways to get the same result.

    Thanks again! I'll implement it soon!

  • Well... I'm confused then...

  • Wait... intval is referring to integer variables. Might that be throwing things off?

    In the example you provided, they're searching for an ID number, aren't they?

  • Is it a publicly hosted dB? If you post the url we could have a play around - this definitely seems like a solvable problem

    Yeah, I was thinking about that, but unfortunately it isn't :(

    I've altered the php file so that it reads:

    $q = intval($_GET['q']);
    $link = mysqli_connect("$host", "$username", "$password", "$db_name");
    
    // Retrieve data from database 
    $sql="SELECT * FROM drawings WHERE name = '".$q."'";
    //DESC LIMIT 10";
    $result=mysqli_query($link,$sql);
    
    // Start looping rows in mysql database.
    while($rows=mysqli_fetch_array($result)){
    echo $rows['name'] . "#" . $rows['artist'] . "|" . $rows['score'] . "|";

    Along with changing the end of my AJAX request so that it has ".php?q=Pickaxe" on the end (as that's one of the words I want to grab.

    Now, instead of grabbing the database, it's grabbing a comma (,) which it's not done before :D

    Obviously that's not what I was hoping for... but a different result is at least interesting.

  • If I’m reading the following correctly, I’d imagine you append ?q=“3” to the end of your get request to complete your example above

    https://www.w3schools.com/php/php_ajax_database.asp

    Hmmm, I see... So it's not quite that simple, as that's basically searching for the ID. So I need to add a GET command to my php, then have the q command linked to something in the AJAX GET.

  • Thank you for the message, but that's pretty much what I already have. My issue appears to be the Construct 2 side of things. Where/How do I tell Construct to tell the Database what word to search for?

    From that example you provided, how do I tell Construct to only download the row associated with the CustomerName Antonio Moreno Taquería?

    AJAX - Request - "https://address/phpname.php?CustomerName=Antonio Moreno Taquería"

    ?

  • I have a database that is accessed using the following php code:

    // Connect to server and select database.
    $link = mysqli_connect("$host", "$username", "$password", "$db_name");
    
    // Retrieve data from database 
    $sql="SELECT * FROM drawings ORDER BY name";
    $result=mysqli_query($link,$sql);
    
    // Start looping rows in mysql database.
    while($rows=mysqli_fetch_array($result)){
    echo $rows['name'] . "#" . $rows['artist'] . "|" . $rows['score'] . "|";
    
    // close while loop 
    }
    
    // close MySQL connection 
    mysqli_close($link);
    ?>
    

    I'm currently using an AJAX GET command such as: "https://address/phpname.php" to grab the data.

    This was fine at first, but the more data I have, the longer it's taking to download it all.

    Does anybody know what changes I need to make to my AJAX GET and the PHP file to grab a specific row, instead of the entire database?

    Say for example I want to grab the row that is titled "Banana" or "John" or "Penguin". What do I need to change the AJAX GET command to so that it states what it's looking for? As well as the changes required to make it work with the php.

    Sorry if this isn't really the right place for such a question, but I've been searching all over the internet, and can't really see how to tie any of their suggestions into Construct 2.

  • Is there a limit to how much data can be uploaded from Construct 2 via AJAX?

    I've created an online database that can support something like 1mil+ characters, and can manually paste data into there without issue. However, when I try to get C2 to post say 100k characters to it, it won't go through. The code is correct in the sense that I can send 5k without issue, but I was just wondering where I might be getting things wrong.

    Is it the AJAX, or might it be something I've done wrong with my database?

  • I've been trying to get this to work for the past 2 days. The tutorial is a bit odd in the sense that the code is presented in a picture instead of something that can either be downloaded or copy/pasted, but that's fine I guess.

    When I try to use the program, I get an error on my site telling me that something has been blocked. When I grant that permission, I lose my site's https and it's labelled as not secure.

    The issue I have is that I do not know where to put the code. Sometimes I see that you just have to upload it to your server. Sometimes I see that you have to have the php code on the root of your website.

    Do I have to give things special permissions?

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • The template is gone... so I have found it and pasted it here.

    Problem description

    Shadows with a height of zero are meant to be infinite. This is not the case.

    Example CAPX

    https://1drv.ms/u/s!Am3CPIM7woZ9g7Qn-JBJTJHHTAKAgw

    Steps to reproduce

    I have set the ShadowLight's position to the mouse X and Y.

    Move it onto the Xs to see the issue.

    Observed result

    The shadows only appear to stretch on for a short distance.

    Expected result

    The shadows are meant to be infinite. The exact same capx when opened in C3 works as expected.

    System details

    R266, Windows 10, tested on everything.

  • It's hard to make sense of the screenshots. But I would guess it's a bug along the lines of "shadows are meant to be infinitely long but aren't" that was fixed in C3.

    Hi Ashley thanks for replying.

    You're correct that the shadows are not infinite in C2. Am I correct in assuming that there are no plans to fix this bug in C2, and that if we'd like to use effective shadows we need to use Construct 3 instead?

  • You might check to see that you're running webgl on C2.

    Hey newt how's it going? Yeah, WebGL is on in C2. Otherwise you can't have soft shadows.

    This is really annoying me XD

AnD4D's avatar

AnD4D

Member since 4 Nov, 2011

Twitter
AnD4D has 3 followers

Connect with AnD4D

Trophy Case

  • 13-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Forum Hero Made 1,000 posts in the forums
  • Coach One of your tutorials has over 1,000 readers
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

20/44
How to earn trophies