How do I AJAX last data

Get help using Construct 2

Post » Tue Nov 25, 2014 8:39 pm

Message: kodisz can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
hi :)
i have problem, because i want to create project like in this tutorial
https://www.scirra.com/tutorials/525/si ... l-database

this is my results (images)
for more info :) tell me in reply

help plzzzz i'm trying to solve this mystery
ps. ohh sorry i forggot show the script
Code: Select all
<?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);
?>
You do not have the required permissions to view the files attached to this post.
B
6
S
2
G
1
Posts: 32
Reputation: 589

Post » Tue Nov 25, 2014 8:50 pm

Hi @kodisz I'll try to help you.
Are you able to identify where it breaks down?
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

Post » Tue Nov 25, 2014 8:50 pm

P.S. It's not normally a good idea to show your passwords in a forum post - replace them with *******
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

Post » Tue Nov 25, 2014 8:58 pm

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
Code: Select all
<?php header('Access-Control-Allow-Origin: *');


i have such results

ps. nieznany = unknown
You do not have the required permissions to view the files attached to this post.
B
6
S
2
G
1
Posts: 32
Reputation: 589

Post » Tue Nov 25, 2014 9:04 pm

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.
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

Post » Tue Nov 25, 2014 9:05 pm

I see you're using xampp - try localhost instead of mysql in this line...
$con=mysqli_connect("mysql","construct2_nowy","construct2_lol","construct2");
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

Post » Tue Nov 25, 2014 9:11 pm

;cc not working

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

????

on image results of open script in browser
You do not have the required permissions to view the files attached to this post.
B
6
S
2
G
1
Posts: 32
Reputation: 589

Post » Tue Nov 25, 2014 9:25 pm

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

login.php?fname=kodisz&fpass=ass12
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

Post » Tue Nov 25, 2014 9:38 pm

ohh sorry hahahha like a idiot ;D
You do not have the required permissions to view the files attached to this post.
B
6
S
2
G
1
Posts: 32
Reputation: 589

Post » Tue Nov 25, 2014 9:38 pm

Did you actually set up the database? You can check via phpmyadmin with xampp.
Image
B
9
S
3
G
1
Posts: 346
Reputation: 1,560

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 25 guests