Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Warning : A table row was 2 columns wide, which is less than the column count established by the first row (4). From line 37,

Warning: A table row was 2 columns wide, which is less than the column count established by the first row (4).

From line 37, column 68; to line 37, column 72

hing!';

Error: Bad character after <. Probable cause: Unescaped <. Try escaping it as <.

At line 41, column 30

while($i < $num) {

Error: Misplaced non-space characters inside a table.

From line 37, column 73; to line 47, column 33

'; } $i = 0; while($i < $num) { $tool_item_no = pg_Result($dbResult, $i, 'tool_item_no'); $name = pg_Result($dbResult, $i, 'tool_name'); $price = pg_Result($dbResult, $i, 'tool_price'); $weight = pg_Result($dbResult, $i, 'tool_weight'); echo ''.

Fatal Error: Cannot recover after last error. Any further errors will be ignored.

From line 37, column 73; to line 47, column 33

'; } $i = 0;

Errors while updating document

Please fix these errors and update it

the document is-

Lab 7

Tool for Sale!

Price is based on unit weight

$db = pg_connect("dbname=webdev");

$query = "select tool_item_no, tool_name, tool_price, tool_weight";

$query .= " from tool_t order";

$query .= " by tool_name;";

$dbResult = pg_query($query);

if(!$dbResult){

die("Database error....");

}

$num = pg_num_rows($dbResult);

if($num == 0) {

echo '

';

}

$i = 0;

while($i < $num) {

$tool_item_no = pg_Result($dbResult, $i, 'tool_item_no');

$name = pg_Result($dbResult, $i, 'tool_name');

$price = pg_Result($dbResult, $i, 'tool_price');

$weight = pg_Result($dbResult, $i, 'tool_weight');

echo '

';

$i++;

}

?>

Tool Price ($/lb) Weight Quantity
';

echo 'Database query retrieved nothing!

'.$name.''.$price.''.$weight.'.';

echo '





Visa

Mastercard

Discover

American Express





Part 3:

I used it for my name and id field for the text box. This way when I go to look up the tool again later on I already have the primary key and thus have to supply less information.

I can send back the primary key and the quantity and everything else I can look up. Now if prices change frequently this may not be a good way to do it initially since then I could possibly give them

the wrong price but only fairly staticly priced items it should be fine.

Part 4:

To get the validation to work I would have to connect to the database and figure out what possible fields I have, based on how many unique ID's I have. From there it wouldn't require much to change, put the various ID's into an

array. Then loop over them and check to make sure it's a number.

Part 5:

The small time I was in your course I had no problems with it. I was also hoping to learn more frameworks and the backend of stuff more. I know this wasn't meant to be an advanced web programming course and thus basics have to be covered.

I know you would like a list but overall this was my only complaint which isn't much of one to begin with. Hope you have a great summer!

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

More Books

Students also viewed these Databases questions

Question

1. Describe the power of nonverbal communication

Answered: 1 week ago