Any one can help me on this it was very urgent..

Hello,

below is my table screen shot, actually i want to show the last added fruit name on my website. If it can be print there based on the date I mean today is 13/July/2018 I haven't added any names there so I want to show an meesage "New fruit name was not added on today " if in the table there was any fruit name added on today date (13/July/2018) that need to print. If any one know how to do it that will be helpful

Screenshot_3.png

Hello, Iam not an expert in PHP as I want to echo latest value from the table please help.

My table name is : sym_fruit

fileds name in the above tables are : id, fruitname, date

each day i will add new fruit to this table so the latest fruit name only need to print, if I didn't added any fruit name on a day i need to show a message "New fruit name was not added on today " in my table (sym_fruit) the date was storing like this ( 12/07/2018 10:14:43pm )
so each day added name are insterted to the table with autoincrument of ID , fruit name and date

I tried below code to ech but it was printitng this text : Array below is my code

<?php 
$pname = $con->select("select fruitname from `sym_fruit` order by `id` desc ",false); ?>       

<?php echo $pname; ?>

Thank you rproffitt , it worked as I was searching for an resolution for this issue but

the forum's and website's are saying to add required or once_required but none of them

worked for me. As it worked I added the line like below so the website started working.

Thanks..

<?php

if (class_exists('MysqlConnect') != true) { 

class MysqlConnect {
    private static $_instance = false;
    private $_con;
    public function __construct() {
        //
    }
    public function __sleep() {
        //
    }
    public function __wakeup() {
        //
    }
    public static function getInstance() {
        if (self::$_instance === false) {
            $instance = new self();
            $instance->_con = mysqli_connect('localhost', 'root', 'password')
                    or trigger_error('Could not connect to database server', E_USER_ERROR);
            mysqli_select_db($instance->_con, 'database_name')
                    or trigger_error('Could not select database', E_USER_ERROR);
            self::$_instance = $instance;
        }
        return self::$_instance;
    }
    public static function dbEscape($value) {
        return self::getInstance()->_escapeString($value);
    }
    public function select($sql, $fetchAll = false) {
//echo $sql;
        $str = mysqli_query($this->_con, $sql);
        if ($fetchAll === false) {
            $row = mysqli_fetch_assoc($str);
            return $row;
        }
        $result = array();
        while (($row = mysqli_fetch_assoc($str))) {
            $result[] = $row;
        }
        return $result;
    }
    public function update($table, $data, $where) {
        $dataUpdate = array();
        foreach ($data as $field => $value) {
            $dataUpdate[] = "`" . $field . "` = " . $this->_escapeString($value);
        }
        if (is_array($where)) {
            $where = '(' . implode(') AND (', $where) . ')';
        }
        $sql = "UPDATE `" . $table . "` SET "
                . implode(',', $dataUpdate) . " WHERE " . $where;
        $result = mysqli_query($this->_con, $sql);
        return $result;
    }
    public function delete($table, $where) {
        $dataDelete = array();
        if ...

Hello,

Iam getting an fatal error " PHP Fatal error: Cannot redeclare class MysqlConnect " It was my connection file and the website was

working from the past two years. Yesterday on of my friend said my website was down so that time i noticed this issue I got the above meesage from my error_log file below I am including my view page and connection page some body please help.

View page

<?php require_once "includes/MysqlConnect.php";
$con = MysqlConnect::getInstance();
$directormessage=$con->select("SELECT * FROM bsi_director_message");
$hotlink=$con->select("SELECT * FROM bsi_hot_links");

?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>website title</title>
<meta name="description" content="website description" />
<meta  name="keywords" content="keyword" />
<link rel="shortcut icon" href="images/favicon.ico">
</head>
<body>
<p><strong><?php echo $directormessage['title'];?></strong></p>
</body>

Connection Page

<?php

class MysqlConnect {

    private static $_instance = false;
    private $_con;

    public function __construct() {
        //
    }

    public function __sleep() {
        //
    }

    public function __wakeup() {
        //
    }

    public static function getInstance() {
        if (self::$_instance === false) {

            $instance = new self();
            $instance->_con = mysqli_connect('localhost', 'root', 'password')
                    or trigger_error('Could not connect to database server', E_USER_ERROR);

            mysqli_select_db($instance->_con, 'database_name')
                    or trigger_error('Could not select database', E_USER_ERROR);

            self::$_instance = $instance;
        }

        return self::$_instance;
    }

    public static function dbEscape($value) {
        return self::getInstance()->_escapeString($value);
    }

    public function select($sql, $fetchAll = false) {
//echo $sql;
        $str = mysqli_query($this->_con, $sql);

        if ($fetchAll === false) {
            $row = mysqli_fetch_assoc($str);
            return $row;
        }

        $result = array();
        while (($row = mysqli_fetch_assoc($str))) {
            $result[] = $row;
        }

        return $result;
    }

    public function update($table, $data, $where) { ...

Hi, as we enabled the url with SSL it was showing error message unable to connect the server. That I have given in the condition, as this issue was only happening when we are enabling SSL to URL. When I have disabled the SSL in the URL the same app working fine.
I belive the issue is beacuse of the org.apache.http.legacy.jar I don't know how to add another alternative. If you can rewrite/ help me to solve the issue that will be helpful

Hi,

I have an app that worked very fine before Iam enabling the SSL to my domian name, I used an web url Ex: api.domian.com

for getting detils to the app like login, result etc. some days before I have added an SSL (lets encrypt) the subdomian name

suddenly the app stopped working and as it was showing the tost error message. I don't know what to do below are the dependcy I have added and the app is connecting to an php scripts so I don't know what to do If any can help me please help

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.2.0'
    compile 'com.android.support:design:23.2.0'
    compile 'com.android.support:recyclerview-v7:23.2.0'
    compile 'com.android.support:cardview-v7:23.2.0'
    compile files('libs/universal-image-loader-1.9.1.jar')
    compile files('libs/org.apache.http.legacy.jar')
    compile files('libs/nineoldandroids-2.4.0.jar')

Main java class

package com.example.abcd.login_logout_register;

import android.content.Intent;
import android.os.AsyncTask;
import android.os.Bundle;
import android.support.design.widget.FloatingActionButton;
import android.support.design.widget.Snackbar;
import android.support.v7.app.AppCompatActivity;
import android.support.v7.widget.Toolbar;
import android.util.Log;
import android.view.View;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

import org.apache.http.HttpResponse;
import org.apache.http.NameValuePair;
import org.apache.http.client.ClientProtocolException;
import org.apache.http.client.HttpClient;
import org.apache.http.client.entity.UrlEncodedFormEntity;
import org.apache.http.client.methods.HttpPost;
import org.apache.http.impl.client.DefaultHttpClient;
import org.apache.http.message.BasicNameValuePair;
import org.apache.http.params.BasicHttpParams;
import org.apache.http.params.HttpConnectionParams;
import org.apache.http.params.HttpParams;
import org.json.JSONException;
import org.json.JSONObject;

import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.util.ArrayList;
import java.util.List;

public class MainActivity extends AppCompatActivity {

    EditText txtUsername;
    EditText txtPassword;
    Button btnLogin;
    String enteredUsername;
    String enteredPassword;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.content_main);

        txtUsername = (EditText) findViewById(R.id.txtUsername);
        txtPassword = (EditText) findViewById(R.id.txtPassword);
        btnLogin = (Button) findViewById(R.id.btnLogin);

        btnLogin.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View v) {
                enteredUsername = txtUsername.getText().toString();
                enteredPassword = txtPassword.getText().toString();

                if(enteredUsername.equals("") || enteredPassword.equals("")){
                    Toast.makeText(MainActivity.this, "Username or password ...

Hi,

You can tet the screens even if your system support fast rendering I mean the AVD will load the emelator screen very fast. In the last version of Android studio you will have all types of screen from the AVD even you can create virtual devices in the three type of screens or you can try any alternate website. Like pcloudy.com there you will get different devices to test it.

Is there any other way because it the current issue was only showing in android 6 and latest versions.

Hello,

I not an expert in android coding but I know little bit, that's why I bought this app from a person. Unfortunately the app author was not giving supporting to me that's why Iam posting this issue here. So please help me, my new app was working fine in older versions but in android 6 and latest version it was stuck in splash screen. In older versions this splash screen was not working/showing. I have enabled the permission in android 6 but after enabling the permission it was stuck in the same screen. I have relaunched the app many time but the same error and same issue it was not go to second screen in android 6 version and not showing splash screen in other versions SO Any one can help me on this please help me. If you needed any other codes please mention in the reply I will update it here..

public class Splash extends AppCompatActivity {
public static final int MY_PERMISSIONS_REQUEST_WRITE_FIELS = 102;
AlertDialog dialog;
@Override
protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.activity_splash);
    getSupportActionBar().hide();

    if (ContextCompat.checkSelfPermission(this,
            android.Manifest.permission.WRITE_EXTERNAL_STORAGE)
            != PackageManager.PERMISSION_GRANTED ||
            ContextCompat.checkSelfPermission(this,
                    android.Manifest.permission.INTERNET)
                    != PackageManager.PERMISSION_GRANTED||
            ContextCompat.checkSelfPermission(this,
                    android.Manifest.permission.READ_EXTERNAL_STORAGE)
                    != PackageManager.PERMISSION_GRANTED||
            ContextCompat.checkSelfPermission(this,
                    android.Manifest.permission.CAMERA)
                    != PackageManager.PERMISSION_GRANTED||
            ContextCompat.checkSelfPermission(this,
                    android.Manifest.permission.ACCESS_NETWORK_STATE)
                    != PackageManager.PERMISSION_GRANTED||
            ContextCompat.checkSelfPermission(this,
                    android.Manifest.permission.ACCESS_COARSE_LOCATION)
                    != PackageManager.PERMISSION_GRANTED||
            ContextCompat.checkSelfPermission(this,
                    android.Manifest.permission.ACCESS_FINE_LOCATION)
                    != PackageManager.PERMISSION_GRANTED
            ) {
        if (ActivityCompat.shouldShowRequestPermissionRationale(this,
                Manifest.permission.WRITE_EXTERNAL_STORAGE) && ActivityCompat.shouldShowRequestPermissionRationale(this,
                Manifest.permission.CAMERA) && ActivityCompat.shouldShowRequestPermissionRationale(this,
                Manifest.permission.READ_EXTERNAL_STORAGE) && ActivityCompat.shouldShowRequestPermissionRationale(this,
                Manifest.permission.INTERNET) && ActivityCompat.shouldShowRequestPermissionRationale(this,
                Manifest.permission.ACCESS_NETWORK_STATE) && ActivityCompat.shouldShowRequestPermissionRationale(this,
                Manifest.permission.ACCESS_COARSE_LOCATION) && ActivityCompat.shouldShowRequestPermissionRationale(this,
                Manifest.permission.ACCESS_FINE_LOCATION)) {
            go_next();
        } else {
            ActivityCompat.requestPermissions(this,
                    new String[]{
                            Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE,
                            Manifest.permission.INTERNET,
                            Manifest.permission.ACCESS_NETWORK_STATE,
                            Manifest.permission.ACCESS_COARSE_LOCATION,
                            Manifest.permission.ACCESS_FINE_LOCATION
                    },
                    MY_PERMISSIONS_REQUEST_WRITE_FIELS);
        }
    }else{
        go_next(); ...

My suggestion is create and two application one in android and another one in IOS which can load webview.. create an responsive wesbite so it will load in theses devices. instert google analytic code in your website so you can get to know what type of devices are using your application. By this way you can show your customer you have mobile application in two platforms. If your application have log in or more advanced options my suggestion is go with cordova or xamarin it was simlar like html but you have deep knowledge in java to make it running..

Hello ,
I want to show some images in my app using php and universal-image-loader-1.9.1 Iam an stater and I have collected some code from
another apps, My problem is when i use the same code to add the gallery in my app it was showing application stopped. If any one can help me to fisx this problem that will be help ful. Below I have added the php code and I want o us universal-image-loader to show the image in the app. In my app there was an gallery area for showing images in albums and recently added pictures so please help me..

My php Code api.php

<?php
    include_once "includes/variables.php";

    DEFINE ('DB_HOST', $host);
    DEFINE ('DB_USER', $user);   
    DEFINE ('DB_PASSWORD', $pass);
    DEFINE ('DB_NAME', $database);

    $mysqli = @mysql_connect (DB_HOST, DB_USER, DB_PASSWORD) OR die ('Could not connect to MySQL');
    @mysql_select_db (DB_NAME) OR die ('Could not select the database');

 ?>
<?php

    mysql_query("SET NAMES 'utf8'"); 
    //mysql_query('SET CHARACTER SET utf8');

    if(isset($_GET['cat_id']))
    {

            $query="SELECT image AS 'images', category_name AS 'cat_name', cid FROM tbl_category c, tbl_gallery n WHERE c.cid=n.cat_id and c.cid='".$_GET['cat_id']."' ORDER BY n.id DESC";         
            $resouter = mysql_query($query);

    }
    else if(isset($_GET['latest']))
    {
            $limit=$_GET['latest'];     

            $query="SELECT * FROM tbl_category c,tbl_gallery n WHERE c.cid=n.cat_id ORDER BY n.id DESC LIMIT $limit";           
            $resouter = mysql_query($query);
    }
    else
    {   
            $query="SELECT * FROM tbl_category ORDER BY cid DESC";          
            $resouter = mysql_query($query);
    }

    $set = array();

    $total_records = mysql_num_rows($resouter);
    if($total_records >= 1){

      while ($link = mysql_fetch_array($resouter, MYSQL_ASSOC)){

        $set['MaterialWallpaper'][] = $link;
      }
    }

     echo $val= str_replace('\\/', '/', json_encode($set));

?>

My connection code in app Constant

package com.solodroid.materialwallpaper; ...

Hello If any one can't read the above code please go to http://pastebin.com/wqPNzG43 I don't know when Iam trying to edite the code it was showin correctly and after posting it was mixed. So please go to the above link and you can see all code please

Iam just stuck on this code I want to add an water mark on in between this process but I don't know how to give it. If the user select upload on the first image the image will uploaded and it will show in the right side. I want to give water mark on each image while user uploading. Please help me if any one can correct this code it will be help full please add the right code in your reply below I have added all the code in that page.

<?php
session_start();
include_once('admin/connection.php');
include_once('functions.php');
include_once('m_loginfunctions.php');

if(checkLoggedin()) 
{ 
$uemail = mysql_real_escape_string($_SESSION['user_sincere']);
$upass = decode3t(mysql_real_escape_string($_SESSION['pass_sincere']));
}
else
{
header("Location: login.php");
}

$str="";$str2="";
$img_str="";$img_str2="";
$regno="";$pid="";
$phto0='';$phto1 ='';$phto2 ='';$phto3 ='';$phto4 ='';$phto5 ='';$phto6='';$phto7='';
$thumb_img="";$thumb_report="";$image_to_be_cropped="";$thumb_full="";

$selquery=mysql_query("select * from `pdetails` where `email`='$uemail' ") or die(mysql_error());

if(mysql_num_rows($selquery)==1)
{
$fet=mysql_fetch_array($selquery);

$regno=$fet['regno'];
$pid = $fet['pid'];
$phto0 = $fet['phto0'];
$phto1 = $fet['phto1'];
$phto2 = $fet['phto2'];
$phto3 = $fet['phto3'];
$phto4 = $fet['phto4'];
$phto5 = $fet['phto5'];
$phto6 = $fet['phto6'];
$phto7 = $fet['phto7'];//kalyana kuri mage

}

if( isset($_GET['phto']) && $_GET['phto']!='' )
{
      $phto = $_GET['phto'];

      switch($phto)
      {

        case 0: $query ="update `pdetails` set `phto0`='' where `pid`='{$pid}' ";
                mysql_query($query);
                  if(mysql_affected_rows()==1){
                  unlink("admin/images/".$phto0); 
                  header("Location: photo.php");
                  }//deleted

                  break;

        case 1: $query ="update `pdetails` set `phto1`='' where `pid`='{$pid}' ";
                mysql_query($query);
                  if(mysql_affected_rows()==1){
                  unlink("admin/images/".$phto1); 
                  header("Location: photo.php");
                  }//deleted

                  break;
        case 2: $query ="update pdetails set phto2='' where pid='{$pid}' ";
                mysql_query($query);
                  if(mysql_affected_rows()==1){
                  unlink("admin/images/".$phto2);
                  header("Location: photo.php");
                  }//deleted

                  break;
        case 3: $query ="update pdetails set phto3='' where pid='{$pid}' ";
                mysql_query($query);
                  if(mysql_affected_rows()==1){
                  unlink("admin/images/".$phto3);
                   header("Location: photo.php");
                  }//deleted

                  break;
        case 4: $query ="update pdetails set phto4='' ...

hericles, you are right I have checked the connection and there I can seen some mistake. the pagination was take by some tutorial website and I have copied the code also in my project while copying I didn't removed the line mysqli to mysql so it was the problem in the connection. Any way thank you for your reply.

$connecDB = mysqli_connect($db_host, $db_username, $db_password,$db_name)or die('could not connect to database');

Post the code here so we can help you very fast.. With out the code it was easy to give you an solution. Google have two type of reCAPTHA, so we need to know are you using the old one or new one..

Hello
Iam getting an error in the pagniation page "Warning: mysql_real_escape_string(): Access denied for user 'username'@'localhost' (using password: NO) in /home/livehuqu/public_html/abcd.com/pptindex.php on line 19 "

Warning: mysql_real_escape_string(): A link to the server could not be established in /home/livehuqu/public_html/abcd.com/pptindex.php on line 19

Iam using the same code in other website and there it was not showing any problems I have checked the code and didn't found any problem in it but now getting this error again and again please help me I need to deliver this website on tomorrow. The code was posted below

<?php include "includes/MysqlConnect.php";
 $con = MysqlConnect::getInstance();
$powerpoint=$con->select("SELECT * FROM `category`ORDER BY `cid`", true);
$result = $con->select("SELECT * FROM `category` ORDER BY `cid` DESC  LIMIT 0,5", true);
  $add= $con->select("SELECT * FROM `advertisement` WHERE addid = 17 ");
 $anamethree=$add['addname'];
 $aimgthree=$add['imgname'];

 $add= $con->select("SELECT * FROM `advertisement` WHERE addid = 16 ");
 $anametwo=$add['addname'];
 $aimgtwo=$add['imgname'];

$adjacents = 3;
$count = $con->select("SELECT COUNT(*) as tot FROM `category` ", false);

$total_pages = $count['tot'];
$targetpage = "pptindex.php";  //your file name  (the name of this file)
$limit = 5;         //how many items to show per page
$page = isset($_GET['page']) ? mysql_real_escape_string($_GET['page']) : 0;
if ($page)
    $start = ($page -1) * $limit;    //first item to display on this page
else
    $start = 0;
//echo "SELECT * FROM `achiev` ORDER BY `achiev_id`  LIMIT ".$start." , ".$limit." ";
$result = $con->select("SELECT * FROM `category` ORDER BY `cid` DESC  LIMIT " . $start . " , " . $limit . " ", true);
if ($page == 0)
    $page = 1; ...

Post your show_cart_update.php code. So It will also help the other to find an right answer for you. If your question is related to JavaScript / DHTML / AJAX please post in that forum and you will get answer as soon..

Find the solution. thanks to urtrivedi..

change the collation to utf8_general_ci in the database because utf8_unicode_ci is requrid in mysql

Changed the line like this

$val=utf8_encode($description);

<--- Removed and

$val=$description; 

<--- added like this

urtrivedi, I have done it but in the editor and the preview page also showing the font like this എന്താ മലയാളം എത്രാ സുന്ദരം . Please tell me is there anything I have missed in the code please go through the paste bin to see my code

Iam facing a problem, Google input tools fonts are not rendering in my website.

iam creating a website which support multi language to type. I have typed in malayalam and the font are showing correctly while trying and in the preview page it was showing like this ( മലയാളഠà´à´¨àµà´¨à´¾ ഭാഷ à´à´¤à´¿ മഹതàµà´¤à´ ) In the database it was store like this (

à ´®à ´²à ´¯à ´¾à ´³à ´‚ à ´Žà ´¨à µÂà ´¨à ´¾ à ´­à ´¾à ´· à ´…à ´¤à ´¿ à ´®à ´¹à ´¤à µÂà ´¤à ´‚

)Iam new to php and I don't know why it was showing like this. I have included the my post page and preview code page in paste bin. please help me I think it will also help other too
Post page: http://pastebin.com/94t9wXVU

Preview page : http://pastebin.com/SHUYpvUW

The error was resolved by checking the code once again

Dear Friends iam facing a problem in the pagination. It was working fine in my offline wamp server

when i moves it to the online it was showing Warning: mysql_real_escape_string() expects parameter 2 to be resource, integer given in /home/pps/public_html/news_and_events.php on line 10

Please help me I have gone through all other post in the but I didn't found any solutions for this. please any one can help me in this one of my another website is also showing the same issue I think may be this was happen because of the server php or Mysql upgrade

If any one can help me in this will be a greatfull. Iam not a professional coder So Iam an starter so please help me .If you can corret the code please add it in the reply

Full code was in the past bin : http://pastebin.com/zegXSWLQ

include 'includes/connect.php';
$con = MysqlConnect::getInstance();

$adjacents = 3;
$count = $con->select("SELECT COUNT(*) as tot FROM `bsi_news_and_events` ", false);
$total_pages = $count['tot'];
$targetpage = "news_and_events.php";  //your file name  (the name of this file)
$limit = 5;         //how many items to show per page
$page = isset($_GET['page']) ? mysql_real_escape_string($_GET['page']) : 0;
if ($page)
    $start = ($page - 1) * $limit;    //first item to display on this page
else
    $start = 0;
//echo "SELECT * FROM `achiev` ORDER BY `achiev_id`  LIMIT ".$start." , ".$limit." ";
$result = $con->select("SELECT * FROM `bsi_news_and_events` ORDER BY `id` DESC  LIMIT " . $start . " , " . $limit . " ", true);
if ...

Iam creating a real estate website and I needed a search box on it. I don't know how to make it, I required users can search plot details by category example below

Note: all the field's are using Drop down box to show the value

1st box : Location (India) , 2nd box: Categeory (Villa,Residential Plot etc..)

3rd box: Min Budget (5Lac) 4th box :Max Budget (same value in the 3rd box)

We have already created the database and all the above value are store in one table. But we don't know how to create a search box for this. If the user select all the value and click on the submit button we need to take them to a search page (search.php) all the result will print there and pagination will show for more result to print from the same page.

If any body can help us please add the code with you comment Please Help me I know it is a simple one an experienced person can make it very easy. So please help it was for our college project we are stuck on this