You are mixing mysqli and mysql extensions in the code, which will not work. mysqli has many improvements over the original mysql extension, so it is recommended to use mysqli .
Tuesday, 3 May 2022
Warning: mysqli_query() expects parameter 1 to be mysqli, resource given
You are mixing mysqli and mysql extensions in the code, which will not work. mysqli has many improvements over the original mysql extension, so it is recommended to use mysqli .
Friday, 29 April 2022
Pre Populate jquery Token input textbox with PhP MySQLi Resultset
- Download jquery token input plugin from https://loopj.com/jquery-tokeninput/
- Extract the zip file and put jquery.tokeninput.js and token-input.css in the application root folder.
- Download the latest version of jquery.min.js
Distributed Systems
Distributed Systems
- Consists of multiple computers and software components that communicate through a computer network.
- Can consist of any number of possible configurations, such as mainframes, workstations, personal computers, and so on.
- The computers interact with each other and share the resources of the system to achieve a common goal
- Reliability (fault tolerance)
- The important advantage of distributed computing system is reliability. If some of the machines within the system crash, the rest of the computers remain unaffected and work does not stop.
- Scalability
- In distributed computing the system can easily be expanded by adding more machines as needed.
- Sharing of Resources
- Shared data is essential to many applications such as banking, reservation system. As data or resources are shared in distributed system, other resources can be also shared (e.g. expensive printers).
- Flexibility
- As the system is very flexible, it is very easy to install, implement and debug new services.
- Speed
- A distributed computing system can have more computing power and it's speed makes it different than other systems.
- Open system
- As it is open system, every service is equally accessible to every client i.e. local or remote.
- Performance
- The collection of processors in the system can provide higher performance (and better price/performance ratio) than a centralized computer.
- Troubleshooting
- Troubleshooting and diagnosing problems.
- Software
- Less software support is the main disadvantage of distributed computing system.
- Networking
- The network infrastructure can create several problems such as transmission problem, overloading, loss of messages.
- Security
- Easy access in distributed computing system increases the risk of security and sharing of data generates the problem of data security
Wednesday, 27 April 2022
Platform as a service (PaaS)
Platform as a service (PaaS)
- The PaaS model provides the tools within an environment needed to create applications that can run in a Software as a Service model
- PaaS is application middleware offered as a service to developers, integrators, and architects.
- Development and Operation teams use PaaS to design, build, and deliver customized applications or information services.
- Instead of relying on standardized SaaS, teams using PaaS have more control over solution architecture, quality of service, user experience, data models, identity, integration, and business logic.
- In PaaS you are given a toolkit to work with, a virtual machine to run your software on, and it is up to you to design the software and its user-facing interface in a way that is appropriate to your needs.
- So PaaS systems range from full-blown developer platforms like Windows Azure to systems like Drupal, Squarespace, Wolf, and others where the tools are modules that are very well developed and require almost no coding.
- PaaS solution will ensure the availability of the application despite downtime of the underlying virtual machine by automatically creating a new instance of the application on a new virtual machine when the machine goes down.
- PaaS systems can be used to host a variety of cloud services
- Online portal-based applications like Facebook that need to scale to thousands of users
- Startup who wants to host their new application in a Software-as-a-Service model
- Can also be used for massively parallel computations
- Enterprises can deploy their Line-of-Business applications in the cloud, taking advantage of the scale and availability while still maintaining security and privacy of data
Amazon Web Services (AWS)
AWS is Amazon’s umbrella description of all of their web-based technology services. Main services include:
- Compute
- Storage
- Database
- Deployment & Management
- Application Services
- Networking
- Content Delivery
Category |
Service |
Compute |
|
Storage |
|
Content Delivery |
|
Database |
|
Deployment & Management |
|
Application Services |
|
Networking |
|
Tuesday, 26 April 2022
SaaS (Software as a Service)
SaaS - Definition
- The most complete cloud computing service model is one in which the computing hardware and software, as well as the solution itself, are provided by a vendor as a complete service offering.
- SaaS is a model where an application is hosted on a remote data center and provided as a service to customers across the internet.
- In this model the provider takes care of all software development, maintenance and upgrades.
- Salesforce.com is a common and popular example of a CRM SaaS application.
- Many people believe that SaaS software is not customizable, and in many SaaS applications this is indeed the case. eg: user-centric application like office suite
- Many other SaaS solutions expose Application Programming Interfaces (API) to developers to allow them to create custom composite applications eg: Salesforce.com, Quicken.com, etc
- The software is available over the Internet globally through a browser on demand
- The typical license is subscription-based or usage-based and is billed on a recurring basis
- The software and the service are monitored and maintained by the vendor, regardless of where all the different software components are running
- Reduced distribution, maintenance costs and minimal end
- user system costs generally make SaaS applications cheaper to use than their shrink-wrapped versions
- Such applications feature automated upgrades, updates, and patch management and much faster rollout of changes
- SaaS applications often have a much lower barrier to entry than their locally installed competitors, a known recurring cost, and they scale on demand
- All users have the same version of the software, so each user's software is compatible with another's
- SaaS supports multiple users and provides a shared data model through a single-instance, multi-tenancy model
- No large upfront costs - usually free trials
- Anywhere, anytime, anyone - mobility
- Stay focused on business processes
- Change software to an Operating Expense instead of a Capital Purchase, making better accounting and budgeting sense.
- Create a consistent application environment for all users
- No concerns for cross platform support
- Easy Access
- Reduced piracy of your software
- Lower Cost:
- For an affordable monthly subscription;
- Implementation fees are significantly lower
- Continuous Technology Enhancements
- Initial time needed for licensing and agreements
- Trust, or the lack thereof, is the number one factor blocking the adoption of software as a service (SaaS).
- Centralized control
- Possible erosion of customer privacy
- Absence of disconnected use
- Not suited to high volume data entry
- Broadband risk
- where you don't have to buy new hardware or update software
- where you pay nothing or pay as much as you use
- where everything is done as a service: Infrastructure, computing, storage and usage
- where you don't worry about your resources spent on Infrastructure security and operational security where you cut your IT spending
- where you have freedom of usage from anywhere with internet connectivity
- which is eco-friendly
- Salesforce.com
- Google Apps
- Gmail, Google Groups, Google Calendar, Talk, Docs, etc
- Google Apps Marketplace (Google apps for both free and for a fee)
- Microsoft Office 365
- Office 365 is a subscription-based online office and software plus services suite which offers access to various services and software built around the Microsoft Office platform
- SaaS is still relatively new and untested
- SaaS is just another version of the failed ASP and hosting models of the past and will suffer the same fate as its predecessors
- SaaS only relieves companies of the upfront costs of traditional software licenses
- SaaS is only for small and mid-sized businesses and will not be accepted by large-scale organizations
- SaaS only applies to applications such as CRM and Salesforce automation
- SaaS will only have a minor impact on the software industry and will fade over time
- It will be easy for the established software vendors to offer SaaS and dominate this market
- SaaS is only for corporate users
Traditional packaged Software |
Saas |
Designed for customers to install, manage and maintain |
Designed from the outset up for delivery as Internet-based services |
Architect solutions to be run by an individual company in a dedicated
instantiation of the software |
Designed to run thousands of different customers on a single code |
Infrequent, major upgrades every 18-24 months, sold individually to
each installed base customer |
Frequent, "digestible" upgrades every 3-6 months to
minimize customer disruption and enhance satisfaction |
Version control |
Version control |
Upgrade fee |
- do - |
Fixing a problem for individual customer |
Fixing a problem for one customer fixes it for everyone |
Monday, 25 April 2022
Export mysqli resultset as excel with nested table in PhP
error_reporting(E_ERROR | E_WARNING | E_PARSE);
$con = mysqli_connect("localhost", "root", "", "tablename");
if (mysqli_connect_errno()) {
echo "Failed to connect to MySQL: " . mysqli_connect_error();
}
$output = '';
$stmt3 = $con->prepare("SELECT id,registrationid,name,email,mobile,nationality,state,district,gender from adv33");
$stmt3->execute();
$stmt3->bind_result($id, $registrationid, $name, $email, $mobile, $nationality, $state, $district, $gender);
$stmt3->store_result();
if ($stmt3->num_rows > 0) {
$output .= '
<table border="1">
<tr>
<th>Name</th>
<th>Email</th>
<th>Mobile</th>
<th>Nationality</th>
<th>State</th>
<th>District</th>
<th>Gender</th>
</tr>
';
while ($stmt3->fetch()) {
$output .= '
<tr>
<td>' . $name . '</td>
<td>' . $email . '</td>
<td>' . $mobile . '</td>
<td>' . $nationality . '</td>
<td>' . $state . '</td>
<td>' . $district . '</td>
<td>' . $gender . '</td>
</tr>';
$output .= '
<table border="1">
<tr>
<td><b>Post</b></td>
<td><b>Company</b></td>
<td><b>From Date</b></td>
<td><b>To Date</b></td>
<td><b>Scale of Pay</b></td>
';
$stmt4 = $con->prepare("SELECT slno,email,post,company,fromdate,todate,scale FROM adv33exp where email ='$registrationid'");
$stmt4->execute();
/* bind result variables */
$stmt4->bind_result($slno, $email, $post, $company, $fromdate, $todate, $scale);
$stmt4->store_result();
if ($stmt4->num_rows > 0) {
/* fetch value */
while ($stmt4->fetch()) {
$output .= '
<tr>
<td>' . $post . '</td>
<td>' . $company . '</td>
<td>' . $fromdate . '</td>
<td>' . $todate . '</td>
<td>' . $scale . '</td>
</tr>
';
}
}
}
$output .= '</table>';
header("Content-type: application/octet-stream");
header("Content-Disposition: attachment; filename=Applicants.xls");
header("Pragma: no-cache");
header("Expires: 0");
echo $output;
}
?>