Customer Service Chat
Get quote & make Payment
Php / mysql issues, computer programming, Programming Languages
Im having problems with my php / mysql code.
I am trying to make it so it looks for an asset Number and if it is in the shop
if the asset is in the database but is not in the shop I want it to change it to be in the shop.
If the asset is not in the database I want it to create a new row with the information provided by my table.
here is all the php code
$table = "shop_inventory";
unset ($db_username, $db_password);
//$Log_Time = $_POST[''Log_Time''];
//$Log_Date = $_POST[''Log_Date''];
$Asset = $_POST[''Asset''];
$Manufacture = $_POST[''Manufacture''];
$Model = $_POST[''Model''];
$sn = $_POST[''sn''];
$Type = $_POST[''Type''];
$Building = $_POST[''Building''];
$RoomNumber = $_POST[''Room_Number''];
$In_Shop = $_POST[''In_Shop''];
$all = mysql_query(''SELECT * FROM $table'');
//$row = mysql_fetch_array($all);
if ("SELECT * FROM $table WHERE Asset=$_POST[Asset] and In_Shop=0")
mysql_query("UPDATE $table SET In_Shop=1 WHERE Asset=$_POST[Asset]");
echo "If ran";
"INSERT INTO $table (Asset, Manufacture, Model, Serial_Number, Type, Building, In_Shop, Room_Number)
($_POST[Asset], $_POST[Manufacture], $_POST[Model], $_POST[sn], $_POST[Type], $_POST[Building], $_POST[In_Shop], $_POST[Room_Number]";
echo "else ran";
echo "$Asset Added to Inventory";
header(''Refresh: 5; URL=../subpages/shopmain.php'');
Posted Date: 3/16/2012 10:47:33 PM | Location : United States
Ask an Expert
Php / mysql issues, computer programming, Assignment Help, Ask Question on Php / mysql issues, computer programming, Get Answer, Expert's Help, Php / mysql issues, computer programming Discussions
Write discussion on Php / mysql issues, computer programming
Your posts are moderated
Write your message here..
Create an application to run in the amazon ec2 service, In this assignment ...
In this assignment you will create an application to run in the Amazon EC2 service and you will also create a client that can run on local machine and access your application. You
Looping, You are required to develop a program that calculates the charges ...
You are required to develop a program that calculates the charges for DVD rentals, where current release cost RM3.50 and all others cost RM2.50. If a customer rents several DVDs, e
Recursion function, Use recursion to dene a function position which has as...
Use recursion to dene a function position which has as input an integer, a character and a string and returns the result of inserting the character in the string at the position s
Windows presentation foundation, Windows Presentation Foundation Designed b...
Windows Presentation Foundation Designed by Microsoft Technologies, the Microsoft Technologies windows Display Groundwork (or WPF) is a computer-software graphic subsystem for maki
What is cisc & risc?, Question 1 What is CISC & RISC? Explain their addres...
Question 1 What is CISC & RISC? Explain their addressing modes Question 2 Discuss the following- Design Specification of Assembler Design of Single Pass Assembler
What is hiding a method? explain, Question 1 Explain the three traits of O...
Question 1 Explain the three traits of Object Oriented Programming Question 2 Write a note on (a) Assignment Operators b) Bitwise Operators.
Design and implement instantiable classes, Overview Goals: The goals for...
Overview Goals: The goals for this assignment are Design and implement instantiable classes. Use arrays of objects. Read from and write to files. Implement basic
Determine the address accessed by given instruction, Determine the address ...
Determine the address accessed by each of the following instruction if DS=1100H, BX=0200H, LIST=0250H AND SI=0500H-: 1) MOV LIST[SI],EDX?0250+0500+11000=11750 2
Matlab help, I am working on a matlab project and need help debugging one q...
I am working on a matlab project and need help debugging one question i have written and need help working through another problem.
Program for deleting nodes from the binary search tree, Problem: This...
Problem: This assignment is about deleting nodes from the binary search tree. You need to use given sequence to construct a binary search tree and then delete some nodes from
Accounting Assignment Help
Economics Assignment Help
Finance Assignment Help
Statistics Assignment Help
Physics Assignment Help
Chemistry Assignment Help
Math Assignment Help
Biology Assignment Help
English Assignment Help
Management Assignment Help
Engineering Assignment Help
Programming Assignment Help
Computer Science Assignment Help
Why Us ?
~24x7 hrs Support
~Quality of Work
~Time on Delivery
~Privacy of Work
Human Resource Management
Literature Review Writing Help
Follow Us |
T & C
Copyright by ExpertsMind IT Educational Pvt. Ltd.