Ajax & PHP & Database

Get help using Construct 2

Post » Wed May 01, 2013 9:57 pm

Hello,

i followed this tutorial.

I got always ID = 0 wich means there is something wrong because the entry's in the database are correct.
here my Events




thanks

yonda

updated picyonda2013-05-01 22:16:10
B
18
S
6
G
3
Posts: 197
Reputation: 4,129

Post » Wed May 01, 2013 10:05 pm

I cant see anything on that photo. Could you share your .capx or upload a larger photo, with area in mind, cropped.
B
50
S
14
G
12
Posts: 813
Reputation: 16,764

Post » Wed May 01, 2013 10:28 pm

[QUOTE=Tekniko] I cant see anything on that photo. Could you share your .capx or upload a larger photo, with area in mind, cropped.[/QUOTE]

Its done, the image should now expand on click
B
18
S
6
G
3
Posts: 197
Reputation: 4,129

Post » Thu May 02, 2013 12:42 am

Should that be 'login.php' and not 'Login.php'.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Thu May 02, 2013 6:10 am

[QUOTE=ramones] Should that be 'login.php' and not 'Login.php'.[/QUOTE]

changed it but still not working
B
18
S
6
G
3
Posts: 197
Reputation: 4,129

Post » Thu May 02, 2013 12:42 pm

Try and get the page working in the browser first. You should be able to go to
http://game.stch.de/login.php?fname='Username'&fpass='Password'
and see the expected output.ramones2013-05-02 12:43:28
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,020

Post » Fri May 03, 2013 1:08 am


My login.php

<?php
$username = $_GET['fname'];
$password = $_GET['fpass'];
$con=mysqli_connect("localhost","dbuser","dbpass","database");
// Check connection
if (mysqli_connect_errno())
{
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
<br>    $qz = "SELECT id FROM members where username='".$username."' and password='".$password."'" ;
$qz = str_replace("\'","",$qz);
$result = mysqli_query($con,$qz);
<br>    while($row = mysqli_fetch_array($result))
{
echo $row['id'];
}
<br>    mysqli_close($con);
?>

plz helpyonda2013-05-03 19:02:29
B
18
S
6
G
3
Posts: 197
Reputation: 4,129

Post » Fri May 03, 2013 7:03 pm

anyone an idea?
B
18
S
6
G
3
Posts: 197
Reputation: 4,129

Post » Sat May 04, 2013 2:49 am

try without adding those ' characters to the ajax string. I have a rather complex login using ajax and get. What kept messing me up was exactly that.
B
68
S
21
G
15
Posts: 701
Reputation: 15,604

Post » Sat May 04, 2013 10:34 am

[QUOTE=lanceal] try without adding those ' characters to the ajax string. I have a rather complex login using ajax and get. What kept messing me up was exactly that.
[/QUOTE]

I did that, but still not working
B
18
S
6
G
3
Posts: 197
Reputation: 4,129

Next

Return to How do I....?

Who is online

Users browsing this forum: No registered users and 21 guests