Category : database

All codes are working fine, but I cannot get the specific data from database, Im using Volley. Example: Toast firstName Everything is working fine except one thing. How can I get the first_name? This is JAVA code StringRequest stringRequest = new StringRequest(Request.Method.POST, URL, new com.android.volley.Response.Listener<String>() { @Override public void onResponse(String response) { Toast.makeText(Home.this, "RESPONSE "+response, ..

Read more

I’m trying to get reactions data from dB and display it using jQuery and ajax but correct data appears after refreshing . the output was wrong but after refreshing the correct number came true my jQuery : <script> $(function () { $(".like{/literal}{$post[‘post_id’]}{literal}").click(function(){ $.ajax({ type:’POST’, url:’/content/themes/default/templates/like.php’, data:{like : "{/literal}{$post[‘post_id’]}{literal}" ,total: "{/literal}{$post[‘reactions_total_count’]}{literal}",post : "{/literal}{$post}{literal}" }, success:function(data){ $(".likescounttest{/literal}{$post[‘post_id’]}{literal}").text(data); ..

Read more

Connections are established by creating instances of the PDO base class. It doesn’t matter which driver you want to use; you always use the PDO class name. class Config { private $host = "localhost"; private $user = "root"; private $password = ""; private $dbname = "php_crud"; public function connect(){ $dsn = ‘mysql:host=’ . $this->host . ..

Read more

I’m now trying to verify the password (type from user) with the phpMyAdmin database hash password using the flask. But why I will get the error message which is 500 Internal server error? Bellow is my code. app.py if request.method == ‘POST’: currentPass = request.form[‘currentPass’].encode(‘utf-8’) newPass = request.form[‘newPass’] rePass = request.form[‘rePass’] hashpass = bcrypt.hashpw(currentPass, bcrypt.gensalt()) ..

Read more