Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I am running an apache2 webserver and want to run a database off of it using phpmyadmin. I am making an android app that needs to connec to make http requests. The app is a simple app where there are 2 buttons and the user can click on the buttons as many times as they want to vote on each person. I was thinking of creating one table with 2 columns in it with the name as "person1" and "perosn2" but according to my research, that won't work. Could anybody give me a simple run through of how i would get this to work. i hve confused myself.
You probably want 2 tables something like this.
People:
id | name
Votes:
id | person_id | timestamp
When someone votes for someone, create a new record on the votes table using the correct person ID. The id could be stored on the android device if it doesn't need to be dynamic.
Related
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I need a web-service which allows admins to insert new data and viewers to see this data-tables. Therefore at first i need a database (Mysql ?). Is a mySql db on a server the right choice? Afterwards a website should be connected to this db, where users can see specific tables and admins can add new lines into this tables. Finally this tables should be able to only show the last xy-lines of the respective table.
Use-case: I have a restaurant, and when I get orders, i want to provide a simple table where the telephone-workers can add new orders (e.g. 3x pizza salami); afterwards this table is opened with view-rights on a display in the kitchen. So the chefs can create the orders.
Which database is the optimal here?
What kind of web-service is the right and how is this connected and set up?
You can use MySQL or SQL Server. And you can use Web Pages instead of web-service.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 6 years ago.
Improve this question
I'm trying to do matchmaking website.
Currently I have two tables which are user profile and their partner profile(which is the requirement that those users hope for). I have to match this two table by using mysql and php. maybe fuzzy logic?
For example, user A hopes for tall partner, then system will match the partner that closes to this user and display on his wall.
But the problem is, i had do many research and still run out of idea of how to do it. Can anyone please help me or give me some advices?Thanks.
Below is what i trying to do but still have no idea.
coding
I think you need one sql:
select * from user
join
partner on
user.user_id = partner.user_id
where
user.email = 'some#email'
Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 7 years ago.
Improve this question
I'm building a php web app that requires to create an invoice, where its ID must be incremented (e.g: 15235, 15236, 15237,...etc). It all works fine with 1 user creating the invoice. The the issue arise when there are more than 1 users hitting the create button at the same time. Supposedly the next incremented ID is 15230, and having 3 users hitting the create button the same time, the app will return 15232 to all 3 users.
FYI, I store the last used ID in a database and increment it when users create an invoice.
Does anyone has any solution? Your suggestion is much appreciated.
Simply use built-in mechanics and define ID field as AUTO_INCREMENT.
You can read more about that here.
After that just skip ID in your INSERT queries and database will take care about that for you.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 8 years ago.
Improve this question
I'm a beginner to this whole mySQL thing and I am working on my first website. I understand how to setup the database I would need for this, but am unsure how I would implement it. I want to allow logged-in members to add input into a list such as the following:
First Name | Last Name | Timestamp | Poster
I want this to be saved to the database. Ideally the member will be able to input into the first two columns and the "timestamp" and "poster" will be automatically filled out. I'm not necessarily looking for a full explanation but maybe someone to point me in the right direction.
Thanks a bunch!
For the timestamp field, you can use a default value, although it is usually best to have your application handling such things (say using an ORM).
To default to the current time, in the mysql console, type:
ALTER TABLE myTable CHANGE COLUMN myColumn DEFAULT TIMESTAMP;
For the user, this will need to be inserted by your application unless you only have 1 user. You should really look at using some sort of Framework to handle these tasks.
Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have a school project and i hit a small snag . I just learned some basic mysql and i can work with single tables/row such as register users , validating logins and outputting all the data in a table.
I now have a more complex issue and i'm not very sure how to proceed .
I need to create a 'courses' that have several subsections such as :
(1) A course can have different lectures for each semester
(2) A lecture has its specific tutorials & labs ( more than one )
I know how to create a single row such as : username , frst name , last name , email etc....
But for the stucture below - i'm not really sure how to do this. I don't have a pre-existing code yet as i have not yet decided how to proceed .
i'm thinking about adding more than one data in the fields like : sections ="TA,TB" but i read that its not recommended in mysql
(source: 4.ii.gl)
(source: 2.ii.gl)
You schould make multiple tables.
One for courses. One for lectures and one for tutorials etc.
Then you bind them togheter woth unique IDs