Profile with saved information

Hi again,

Please let me know if I do go off topic as it is important to stay on topic for others help if needed.

I was thinking to not change the script to help with listview as I do not know where to start with script change even.
I was thinking to keep your recommendation on the login system but add a tag textbox for the listview and use the tag to safe my listview info in CloudDB.

Do you think this will work, seeing cloudDB gets store on mit server?

Example: username and password will be connected to a tag to retain the listview info.

Honest opinion :blush:

Messy !!

What profile information do you want to store and retrieve for each user?

I have a google sheet with team names and images of the teams on which I converted to a listview. (I have teams on google sheet because it is easier to change info or update info of the team on google sheet and then app will atomically update in a second or two)

User will select a team or teams from the Team listview and this team will go into their profiles listview.

This is why I want to store the listview info of the user and retain it when they logged in.

I have try to convert listview to textbox and store the textbox to google sheet but then to reverse back into listview makes things hard because there is no set number of teams in each user profile. (Listview will be showing Image and text)

Due to the blocks of the login system only display one column and i need username and password, I have made username a selection option and then used password textbox matching password textbox for the app to confirm it is correct user.

However, it will be ideal to not have a user selection option and instead to have a user textbox and login button.

Please advise if possible

Hi,

I am using your recommended login system.

Having problem with update selection.
The login system request me to update all my textboxes. I want textboxes to be optinal for users.

Example:
If they only want to change their username or password and nothing else.

Can you please help, the blocks the same as recommended system.

You will most likely need a CRUD system for this.

See here

Thanks, will try it later. :grinning:

Apologies but I am actually using the Crud system

Good, then you should be able to update a value on your spreadsheet from your app.

I can update, no problem.

But forces me/user to change name.
If i don't change anything and only change one thing (example date of birth) then says this ID exists already.

Then you do not have CRUD :wink:

I have noticed the problem was on my side.
Because the login usernames all goes to a lsitview from googlesheet and works on selection option only, I needed to do something so the listview gets atomically selected.

I made the google sheet to search username and put the user details at the top on the listview.

All of this did not work.. :frowning:

Still need a login system with password where I can load users details and update as needed.

Perhaps see here for a different CRUD example

Hi TIMA12,

Will likely be using your recommendation but then how do I pull up the user's saved information then?

I want user to login on any phone and get their saved information.

I think can use XAMPP, phpmyadmin as DB but i am not sure how i am supposed to arrange the blocks

This is what I am trying to do:

Screen 1

  1. User Login
  2. user enter username and password (will pass if data exist in db)

Screen 2

  1. User enter input (notes)
  2. user able to apply the crud to the data

how do i ensure that each data saved with correct user
?

@MUHAMMAD_ZIKRI_BIN_Y

Then your approach: XAMPP/mySQL, will require a different method to using CRUD for Google Sheets.

You might look here for salvation:

image
image

can you help me with this ? how do i past the value (username) from mit app inventor to the sql and then the sql will will return "content", "notesid", and "date" that only associated with the username that just been pass from mit

this is my sql:

<?php

include "connect.php"; // Database connection

// Retrieve and sanitize the username from POST request

$username = mysqli_real_escape_string($conn, $_POST['username']);

// SQL query to select notes for the given username

$data = mysqli_query($conn, "SELECT notesid, content, date FROM NOTES WHERE username='$username'");

if (!$data) {

die("Error in SQL query: " . mysqli_error($conn));

}

$results = array();

while ($row = mysqli_fetch_assoc($data)) {

$results[] = $row;

}

// Return the results as JSON

header('Content-Type: application/json');

echo json_encode($results);

// Close the database connection

mysqli_close($conn);

?>

Show some example records in your mysql

Remove the Get method

and show us the response content

Taifun

Select list item: Attempt to get item number 2 of a list of length 1: [["error", "No records found"]]
Note: You will not see another error reported for 5 seconds.

how do i fix this error, i still confuse with how index work in mit. this is my blockcode
image
image

and these are blockcode from listview page:

display for listviewpage;

display for listview(afterclick)page

this is my sql code:

<?php include "connect.php"; // Database connection $title = @$_POST['title']; //$title = "SELASA"; // Use prepared statements to avoid SQL injection and syntax errors $stmt = $conn->prepare("SELECT * FROM NOTES WHERE title = ?"); $stmt->bind_param("s", $title); $stmt->execute(); $res = $stmt->get_result(); // Initialize an empty array to hold the results $json = []; // Fetch the results and check if there are any rows if ($res->num_rows > 0) { while ($r = $res->fetch_array(MYSQLI_ASSOC)) { $json[] = $r; } } else { // Handle the case where no records are found $json = ["error" => "No records found"]; } echo json_encode($json, JSON_UNESCAPED_UNICODE); // Free the result and close the connection $stmt->free_result(); $stmt->close(); $conn->close(); ?>

Unfortunately you did not provide the raw response content...
My guess is, ypur php script is returning this

from your php code

// Handle the case where no records are found $json = ["error" => "No records found"];

what is the value of nametxt?
is it any reasonable notesid value?

let me suggest you to use a working solution

and if you got that running, adjust it to your needs

unknown

and using virtual screens would make your life much easier, see tip 1 here General Tips and Tricks for App Inventor

Taifun

1 Like