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..
What is multithreaded programming, Question: (i) What is multithreaded...
Question: (i) What is multithreaded programming? Lists the benefits achieved by multithreading your code in a program. (ii) What type of coding should be eliminated when d
Selfcare project - strut frame work, Selfcare Project: Technology U...
Selfcare Project: Technology Used Strut Frame work, WAS 5.1, WPS 6.0, DB2, AJAX, Eclipse, Rational Application Developer 6 and DB2 Selfcare is a big umbrella under whic
Programme for create the class in the karel++ , Create the class Robot desc...
Create the class Robot described in the Karel++ book. Description: The Robot class described in the Karel++ text is a derived class of ur_Robot. Create class Robot as a d
Write a program to use a robot to move, Write a program to use a robot to m...
Write a program to use a robot to move the stack of blocks from a source location to a target location, based. Movement of robot arms, picking and dropping, can be controlled usi
Create an xslt stylesheet-attributes to elements , Attributes to Elements ...
Attributes to Elements Create an XSLT stylesheet that converts all attributes found in a given XML document to elements.Use the sample instance from question 2 to test the tra
Multi-targeting .net structure, Support for Multi-Targeting The multi-targe...
Support for Multi-Targeting The multi-targeting function of Vision Facilities allows you specify the particular edition or account of the .NET Structure that is required for your p
Write a function that will read the atoms for a protein, Write a function r...
Write a function readPDBfile('filename') that will read the atoms for a protein stored in a PDB file, whose name is provided as an input to the function (note that this name should
Brent''s method, This is what I have so far def root_brent(f, a, b, errorl...
This is what I have so far def root_brent(f, a, b, errorlimit = tinyerror, n = -1, r_i = 0): # f(a) and f(b) must have opposite signs poly = remove_multiple_roots(poly) counter
Computer games development, Lazytown Constabulary are concerned that young ...
Lazytown Constabulary are concerned that young people in the town are unaware of the sorts of crime that they might encounter in their daily lives and are concerned that they may b
Find the general solution, Example : Find the general solution to the subse...
Example : Find the general solution to the subsequent differential equation. x 2 y′′ - 7 xy′ + 16 y= 0 Solution First the roots of (3) r (r -1) - 7r + 16= 0 r 2
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
IT Courses and 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.