SlideShare a Scribd company logo
<?php
/*Esta lineaespara incluirel archivoconlasvariables*/
include "registro.php";
/* CONECTARCON BASEDE DATOS**************** */
$con = mysql_connect($hostname,$user,$pass);
if (!$con){die('ERRORDECONEXION CON MYSQL: ' . mysql_error());}
/* ********************************************** */
/* CONECTA CON LA BASEDE DATOS **************** */
$database = mysql_select_db("inventario",$con);
if (!$database){die('ERRORCONEXIONCON BD:'.mysql_error());}
/* ********************************************** */
//REALIZARCONSULTA
$sql = "INSERT INTOregistrarVALUES
(NULL,'".$_POST['cod_patrimonial']."','".$_POST['fecha_registrar']."','".$_POST['area']."','".$_POST
['encargado']."','".$_POST['hardware']."','".$_POST['marca']."','".$_POST['modelo']."','".$_POST['de
scripcion']."')";
$result= mysql_query($sql);
if (! $result){
echo"La consultaSQLcontiene errores.".mysql_error();
exit();
}else {echo"<center><fontcolor='RED'>DATOSINSERTADOS
CORRECTAMENTE</font><aref='http://localhost/inventario2/index.php'>Volver</a&gt;'";
}
?>
<?php
$hostname = "localhost";//enmi casoes localhost
$user = "root"; //enmi caso root
$pass = "";
?>
Conexion php

More Related Content

DOCX
Latihan form login
PDF
与 PHP 和 Perl 使用 MySQL 数据库
PPT
Lecture6 display data by okello erick
TXT
Threading
PDF
Laravel, the right way - PHPConference 2016
PDF
Laravel the right way
PPTX
File upload for the 21st century
Latihan form login
与 PHP 和 Perl 使用 MySQL 数据库
Lecture6 display data by okello erick
Threading
Laravel, the right way - PHPConference 2016
Laravel the right way
File upload for the 21st century

What's hot (19)

PPT
Php Mysql
DOCX
TICT #11
DOCX
TICT #13
PDF
TDC2015 Porto Alegre - Automate everything with Phing !
PPTX
Cake PHP 3 Presentaion
XLS
Up.Php
PDF
FLOW3, Extbase & Fluid cook book
PDF
PHP and Rich Internet Applications
PDF
SQL so close I can paste it (YAPC::NA::2011 lightning talk)
PPTX
Php verses my sql
PDF
Information Science Blog Aggregation
PDF
Growing jQuery
TXT
[Php] navigations
PDF
How Kris Writes Symfony Apps
PDF
How kris-writes-symfony-apps-london
PPTX
Image upload in php MySql
PDF
Darkmira Tour PHP 2016 - Automatizando Tarefas com Phing
PDF
Php verses MySQL
Php Mysql
TICT #11
TICT #13
TDC2015 Porto Alegre - Automate everything with Phing !
Cake PHP 3 Presentaion
Up.Php
FLOW3, Extbase & Fluid cook book
PHP and Rich Internet Applications
SQL so close I can paste it (YAPC::NA::2011 lightning talk)
Php verses my sql
Information Science Blog Aggregation
Growing jQuery
[Php] navigations
How Kris Writes Symfony Apps
How kris-writes-symfony-apps-london
Image upload in php MySql
Darkmira Tour PHP 2016 - Automatizando Tarefas com Phing
Php verses MySQL
Ad

Recently uploaded (20)

PPTX
Patient Appointment Booking in Odoo with online payment
PPTX
Weekly report ppt - harsh dattuprasad patel.pptx
PDF
17 Powerful Integrations Your Next-Gen MLM Software Needs
PDF
Wondershare Filmora 15 Crack With Activation Key [2025
PDF
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
PPTX
CHAPTER 2 - PM Management and IT Context
PDF
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
PDF
Nekopoi APK 2025 free lastest update
PDF
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PPTX
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
PDF
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 41
PPTX
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
PPTX
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
PDF
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
PDF
Odoo Companies in India – Driving Business Transformation.pdf
PDF
CapCut Video Editor 6.8.1 Crack for PC Latest Download (Fully Activated) 2025
PDF
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
PDF
Salesforce Agentforce AI Implementation.pdf
Patient Appointment Booking in Odoo with online payment
Weekly report ppt - harsh dattuprasad patel.pptx
17 Powerful Integrations Your Next-Gen MLM Software Needs
Wondershare Filmora 15 Crack With Activation Key [2025
How to Make Money in the Metaverse_ Top Strategies for Beginners.pdf
CHAPTER 2 - PM Management and IT Context
CCleaner Pro 6.38.11537 Crack Final Latest Version 2025
Nekopoi APK 2025 free lastest update
Product Update: Alluxio AI 3.7 Now with Sub-Millisecond Latency
Design an Analysis of Algorithms II-SECS-1021-03
Embracing Complexity in Serverless! GOTO Serverless Bengaluru
AI-Powered Threat Modeling: The Future of Cybersecurity by Arun Kumar Elengov...
Internet Downloader Manager (IDM) Crack 6.42 Build 41
AMADEUS TRAVEL AGENT SOFTWARE | AMADEUS TICKETING SYSTEM
WiFi Honeypot Detecscfddssdffsedfseztor.pptx
Tally Prime Crack Download New Version 5.1 [2025] (License Key Free
Odoo Companies in India – Driving Business Transformation.pdf
CapCut Video Editor 6.8.1 Crack for PC Latest Download (Fully Activated) 2025
iTop VPN 6.5.0 Crack + License Key 2025 (Premium Version)
Salesforce Agentforce AI Implementation.pdf
Ad

Conexion php

  • 1. <?php /*Esta lineaespara incluirel archivoconlasvariables*/ include "registro.php"; /* CONECTARCON BASEDE DATOS**************** */ $con = mysql_connect($hostname,$user,$pass); if (!$con){die('ERRORDECONEXION CON MYSQL: ' . mysql_error());} /* ********************************************** */ /* CONECTA CON LA BASEDE DATOS **************** */ $database = mysql_select_db("inventario",$con); if (!$database){die('ERRORCONEXIONCON BD:'.mysql_error());} /* ********************************************** */ //REALIZARCONSULTA $sql = "INSERT INTOregistrarVALUES (NULL,'".$_POST['cod_patrimonial']."','".$_POST['fecha_registrar']."','".$_POST['area']."','".$_POST ['encargado']."','".$_POST['hardware']."','".$_POST['marca']."','".$_POST['modelo']."','".$_POST['de scripcion']."')"; $result= mysql_query($sql); if (! $result){ echo"La consultaSQLcontiene errores.".mysql_error(); exit(); }else {echo"<center><fontcolor='RED'>DATOSINSERTADOS CORRECTAMENTE</font><aref='http://localhost/inventario2/index.php'>Volver</a&gt;'"; } ?> <?php $hostname = "localhost";//enmi casoes localhost $user = "root"; //enmi caso root $pass = ""; ?>