How to query in Codeigniter with limit and without limit for pagination?

$this->db->start_cache();

$this->db->select("p.*");
$this->db->from('product p');

$this->db->where("p.cat_id", "12");
$this->db->group_by("p.id");

$this->db->stop_cache();

# Get total number of products
$total_product = $this->db->count_all_results();

# show only 5 products
$this->db->limit(5, 0);

$query = $this->db->get();
$this->db->flush_cache();

        
$result 	  = $query->result_array();
$result_count = $query->num_rows();

You cannot call save() after accessing serializer.data in Django Seriliazer

YOU CANNOT CALL `.SAVE()` AFTER ACCESSING `SERIALIZER.DATA`.IF YOU NEED TO ACCESS DATA BEFORE COMMITTING TO THE DATABASE

As the above error says, “If you need to access data before committing to the database then inspect ‘serializer.validated_data’ instead.

Written code:

serializerdata = serializers.CreateSerializer(data=request.data)
if serializerdata.is_valid():
    user_id = serializerdata.data.get('user_id')
    if user_id==2:
        serializerdata.save(i_created_by=request.user)
        return JsonResponse({"message": "success"}) 
    else:
        return JsonResponse({"message": "user invalid"})    
else:
    return JsonResponse({"message": "error"}) 

Solution: we can call this to access the data, like:-

user_id = serializerdata.validated_data.get('user_id')
serializerdata = serializers.CreateSerializer(data=request.data)
if serializerdata.is_valid():
    user_id = serializerdata.validated_data.get('user_id')
    if user_id==2:
        serializerdata.save(i_created_by=request.user)
        return JsonResponse({"message": "success"}) 
    else:
        return JsonResponse({"message": "user invalid"})    
else:
    return JsonResponse({"message": "error"}) 

Google Business Listing has been Suspended Due to Quality Issues!

As, Google Says…..

We may take action on listings and user accounts that violate our content and conduct policies.

If we remove a listing: The public can’t access the listing anymore. The owner and managers can’t take actions on its behalf, though they can still make edits and appeal to be reinstated. If the listing is reinstated, we’ll also reinstate the owner and managers.

If we remove the owner’s Google Account: We’ll also remove all of the listings owned by that user. If we reinstate the owner’s Google Account, we’ll also reinstate the listings.

If we remove a manager’s Google Account: We’ll suspend the manager on the listings they manage, but the listings themselves will be unaffected. If we reinstate the manager’s Google Account, the manager will automatically regain managerial access to the listings.

source: Google

To Know about on google click here: https://support.google.com/maps/forum/AAAAQuUrST8PDj31RqLiTU/?hl=en&gpf=%23!topic%2Fmaps%2FPDj31RqLiTU

Best & Cheapest Web Hosting in India for starter with Xozz

We always want to start our own website. But Due to the huge hosting Charge, we avoid our decisions.

I was also finding these types of hosting provider. Initially we don’t have more money to invest on the website & hosting etc. After searching & hosting on many free hosting accounts, I found xozz.in.

Best Web Hosting & Re-seller Hosting in India

Xozz.in is the best for me. I don’t have huge traffic in my website that I have to need more space. Here xozz team are providing the hosting with a minimum costing. If i can afford this hosting you can also. Because after to many searching and hosting on many free server, finally i got my paid hosting with xozz.

Features they are providing Like:

  • Unlimited SSD Disk Space
  • Unlimited Bandwidth
  • Unlimited Database
  • Unlimited Emails
  • Free DOT COM Domain, with exciting offers
  • Powerful RAM
  • Hosting 1 website
  • Cpanel
  • 24×7 Support

Yes, All of these they are providing with a minimum price. I am not Advertising. But I really used their service. Currently I am also using their service (xozz.in).

You can Register your domain name.
Cheap & Best Hosting Plan for Beginners & Developers

Web Hosting & Re-seller Hosting in India
All the features you need to build the website of your dreams – without the hassle.

Really It helps me a lot. When I had not enough money, this hosting helps me.

They are proving few site builders like- Powerful Weebly Site Builder