Search Posts

How to create a table inside mysql database via an android application?

how to – How to create a table inside mysql database via an android application? I’m working on an android application that asks the user for number of classes under his/her wing and than create a list of those classes. Now when the user will click on one of the class, it will ask the no. of students inside that class and then the user will enter the name of students. So, internally it will […]

PHP script doesen’t insert data in MySQL

how to – PHP script doesen’t insert data in MySQL I’ve created this script to insert some data from PHP to MySQL, but it doesen’t work, and I don’t know why. if (isset($_SESSION[‘userSession’])!=””) { $session_created=1; $session_query = “SELECT * FROM users WHERE user_id=”.$_SESSION[‘userSession’]; $session_query_result = $DBcon->query($session_query); $user_row=$session_query_result->fetch_array(); } if(isset($_POST[‘create_post_button’])){ $post_name = $DBcon->real_escape_string(strip_tags($_POST[‘post_title’])); $post_content = $DBcon->real_escape_string(strip_tags($_POST[‘post_content’])); date_default_timezone_set(‘Europe/Athens’); $post_date=date(“Y-m-d h:i:sa”); $post_categ_id = $DBcon->real_escape_string(strip_tags($_POST[‘post_category’])); $post_creator = $user_row[‘user_name’]; $pass_flag=0; $error_msg_cp = “Posted!”; $create_post_query = “INSERT INTO posts(post_name,post_content,post_date, post_categ_id,post_user_name) VALUES […]

Some concerns on online exam system

how to – Some concerns on online exam system I’m recently developing online exam module for school management system. And i have some concerns about the following things: When user accidentally close the browser, or logout his or her account while taking the exam, how i supposed to save the current answers of the exam for continue the exam if user login back or open the url which is supposed to continue exam one’s recent […]

Inserting related data with Sequelize ORM

how to – Inserting related data with Sequelize ORM I have two models: Post and Comment. and they have One to Many relationships between them. Post: title body Comment: body PostId This is how i save comments in the table: Comments.create({ where: { body: req.body.body, PostId: req.params.post_id }); but this is what documentation says: Post.create()… Comment.create()… // save them… and then: Post.setComments([comment]).then(() => { // saved! }) is it necessary to use setComments to set […]

How to save multiple addresses field for a single user in eloquent

how to – How to save multiple addresses field for a single user in eloquent I wanna save and retrieve multiple addresses for a user, also have created multiple address field using JQuery public function store(Request $request) { $user = new User(); $data = $this->validate($request, [ //User detail ‘name’ => ‘required’, ‘gender’ => ‘required’, ‘phone’ => ‘required’, //Address fields ‘city’ => ‘required’, ‘state’ => ‘required’, ‘country’ => ‘required’ ]); } I can get input for […]

MySQL – Concatenate Existing Fields in New Generated Field

how to – MySQL – Concatenate Existing Fields in New Generated Field In my table, I have two fields: book and reference. Neither are required to be unique on their own. However, the concatenated value of these two values must be unique. I’m trying to create a generated column that concatenates the two, but I’m receiving the following error message when running the SQL: Executing: ALTER TABLE `bibleverses`.`myverses` ADD COLUMN `fullref` VARCHAR(20) GENERATED ALWAYS AS […]

Use direct connection from Java application to Mysql Workbench? Or create a Php/Java server between to deliver data?

how to – Use direct connection from Java application to Mysql Workbench? Or create a Php/Java server between to deliver data? I am developing multiple user desktop application in Java. I have modeled.implemented and populated my Database model in MySQL Workbench. I’m worrying about to do: How to get data from my database to my Java application? My application needs to be secure. Should I use the direct connection to MySQL or should I create […]

Populate dropdown from Another MySQL table – php

how to – Populate dropdown from Another MySQL table – php I want to populate course list inside a dropdown but use the id from the student table to select its value in the edit page. Database course +—-+————-+ | id | course_name | +—-+————-+ | 1 | English | | 2 | Math | | 3 | Social | | 4 | Arts | | 5 | History | +—-+————-+ student +—-+——–+—–+——–+ | id […]

On successful signup redirect to login

how to – On successful signup redirect to login I have a login and register page as shown in below image. Both are inside same form but different div tags. When on register it should be redirected to login page. This is my code for the login form. Login code <div class=”container”> <div class=”flat-form”> <ul class=”tabs”> <li> <a href=”#login”>Login</a> </li> <li> <a href=”#register”>Register</a> </li> </ul> <div id=”login” class=”form-action active”> <h1>Login</h1> <form action=”thanks.php” method=”post”> <ul> <li> […]

How get emojis to work with mysql 5.7?

how to – How get emojis to work with mysql 5.7? Im trying to get emojis to work in with my mysql 5.7 and .asp pages. I have set the db and tables to use the right collections etc. In the mysql my.ini file I have this. [client] default-character-set = utf8mb4 [mysql] default-character-set = utf8mb4 [mysqld] init-connect=’SET NAMES utf8mb4′ character-set-server=utf8mb4 character-set-client-handshake = FALSE collation-server = utf8mb4_unicode_ci And if I in mysql workbench writes this. SHOW […]

Next Page »