howrandom
-
Posts
11 -
Joined
-
Last visited
Never
Posts posted by howrandom
-
-
im doing it using a local server as it is only for a college project
-
yes this works i can click on the links but now the data doesnt show it will just paste "$myrow[0] or 1 in the according field but the link is working
-
<HTML>
<BODY>
<body bgcolor="#FFFFCC" text="#006600" link="#0000FF" vlink="#0000FF" alink="#0000FF">
<?php
$db=mysql_connect("localhost","hnd","");
mysql_select_db("hnd",$db);
$result=mysql_query("SELECT * FROM RB_Products",$db);
echo "<table border=1>\n";
echo "<TR>
<TD><h2>Item Number</h2></TD>
<TD><h2>Item Name</h2></TD>
<TD><h2>Cost</h2></TD>
<TD><h2>Postage</h2></TD>
<TD><h2>Category</h2></TD>
<TD><h2>In Stock</h2></TD>
<TD><h2>Image</h2></TD>
<TD><h2>Order</h2></TD>
</TR>\n";
while($myrow = mysql_fetch_array($result)){
echo
"<TR>
<TD><h3>$myrow[0]</h3></TD>
<TD><h3>$myrow[1]</h3></TD>
<TD><h3>$myrow[2]</h3></TD>
<TD><h3>$myrow[3]</h3></TD>
<TD><h3>$myrow[4]</h3></TD>
<TD><h3>$myrow[5]</h3></TD>
<TD><img src=$myrow[6]></TD>
(line 30!)echo '<TD><a href="'.$myrow[7].'">Link</a></TD>';
</TR>";
}
echo "</table>\n";
?>
</BODY>
</HTML>
there is a ; at the end, still doesnt work... -
Parse error: parse error, expecting `','' or `';'' in c:\program files\nusphere\apache\htdocs\viewstock.php on line 30
-
[!--quoteo(post=384327:date=Jun 15 2006, 08:15 PM:name=annihilate)--][div class=\'quotetop\']QUOTE(annihilate @ Jun 15 2006, 08:15 PM) [snapback]384327[/snapback][/div][div class=\'quotemain\'][!--quotec--]
[code]echo '<TD><a href="'.$myrow['7'].'">Link</a></TD>';[/code]
[/quote]
This doesnt work
I dont understand what you mean businessman332211 -
hey there, i have done the kind of thing you want, im new to this so im not sure how to ecplain it but if you look at my code you may be able to see what pieces you need.
<HTML>
<BODY>
<body bgcolor="#FFFFCC" text="#006600" link="#0000FF" vlink="#0000FF" alink="#0000FF">
<?php
$db=mysql_connect("localhost","hnd","");
mysql_select_db("hnd",$db);
if($Submit2) {
$sql="UPDATE RB_Customer
SET Title = '$Title',
First_Name = '$First_Name',
Last_Name = '$Last_Name',
Age = '$Age',
Address_Line_1 = '$Address_Line_1',
Address_Line_2 = '$Address_Line_2',
City = '$City',
County = '$County',
Postcode = '$PostCode',
Telephone_Number = '$Telephone_Number',
E_Mail = '$E_Mail'
WHERE Cust_Number = '$Cust_Number'";
$result=mysql_query($sql,$db);
echo "$sql Record updated/edited!<p>";
}
if($Submit) {
$sql="SELECT * FROM RB_Customer WHERE Cust_Number='$ID'";
$result=mysql_query($sql,$db);
$myrow = mysql_fetch_array($result);
echo"
<form method = \"post\" action = \"updatecust2.php\">
Title:<input type = \"Text\" name=\"Title\" value='$myrow[11]'<BR>
First_Name:<input type = \"Text\" name=\"First_Name\" value='$myrow[1]'<BR>
Last_Name:<input type = \"Text\" name=\"Last_Name\" value='$myrow[2]'<BR>
Age:<input type = \"Text\" name=\"Age\" value='$myrow[3]'<BR>
Address_Line_1:<input type = \"Text\" name=\"Address_Line_1\" value='$myrow[4]'<BR>
Address_Line_2:<input type = \"Text\" name=\"Address_Line_2\" value='$myrow[5]'<BR>
City:<input type = \"Text\" name=\"City\" value='$myrow[6]'<BR>
County:<input type = \"Text\" name=\"County\" value='$myrow[7]'<BR>
Postcode:<input type = \"Text\" name=\"PostCode\" value='$myrow[8]'<BR>
Telephone_Number:<input type = \"Text\" name=\"Telephone_Number\" value='$myrow[9]'<BR>
E_Mail:<input type = \"Text\" name=\"E_Mail\" value='$myrow[10]'<BR>
Cust_Number:<input type = \"Text\" name=\"Cust_Number\" value='$myrow[0]'<BR>
<input type = \"Submit\" name=\"Submit2\" value = \"Enter Information\">
";
}
$result=mysql_query("SELECT * FROM RB_Customer",$db);
echo "<table border=1>\n";
echo "<TR>
<TD><h2>Customer Number</h2></TD>
<TD><h2>Title</h2></TD>
<TD><h2>First Name</h2></TD>
<TD><h2>Last Name</h2></TD>
<TD><h2>Age</h2></TD>
<TD><h2>Address Line 1</h2></TD>
<TD><h2>Address Line 2</h2></TD>
<TD><h2>City</h2></TD>
<TD><h2>County</h2></TD>
<TD><h2>PostCode</h2></TD>
<TD><h2>Telephone Number</h2></TD>
<TD><h2>E-Mail Address</h2></TD>
</TR>\n";
while($myrow = mysql_fetch_array($result)){
echo "
<TR>
<TD><h3>$myrow[0]</h3></TD>
<TD><h3>$myrow[11]</h3></TD>
<TD><h3>$myrow[1]</h3></TD>
<TD><h3>$myrow[2]</h3></TD>
<TD><h3>$myrow[3]</h3></TD>
<TD><h3>$myrow[4]</h3></TD>
<TD><h3>$myrow[5]</h3></TD>
<TD><h3>$myrow[6]</h3></TD>
<TD><h3>$myrow[7]</h3></TD>
<TD><h3>$myrow[8]</h3></TD>
<TD><h3>$myrow[9]</h3></TD>
<TD><h3>$myrow[10]</h3></TD>
</TR>";
}
echo "</table>\n";
?>
<form method = "post" action = "<?php echo $PHP_SELF?>">
ID:<input type = "Text" name="ID"><BR>
<input type = "Submit" name="Submit" value = "Choose Record To Be Updated">
</BODY>
</HTML>
-
Hi i am doing a database for a college project and i am getting really confused, my code is the following:
<HTML>
<BODY>
<body bgcolor="#FFFFCC" text="#006600" link="#0000FF" vlink="#0000FF" alink="#0000FF">
<?php
$db=mysql_connect("localhost","hnd","");
mysql_select_db("hnd",$db);
$result=mysql_query("SELECT * FROM RB_Products",$db);
echo "<table border=1>\n";
echo "<TR>
<TD><h2>Item Number</h2></TD>
<TD><h2>Item Name</h2></TD>
<TD><h2>Cost</h2></TD>
<TD><h2>Postage</h2></TD>
<TD><h2>Category</h2></TD>
<TD><h2>In Stock</h2></TD>
<TD><h2>Image</h2></TD>
<TD><h2>Order</h2></TD>
</TR>\n";
while($myrow = mysql_fetch_array($result)){
echo
"<TR>
<TD><h3>$myrow[0]</h3></TD>
<TD><h3>$myrow[1]</h3></TD>
<TD><h3>$myrow[2]</h3></TD>
<TD><h3>$myrow[3]</h3></TD>
<TD><h3>$myrow[4]</h3></TD>
<TD><h3>$myrow[5]</h3></TD>
<TD><img src=$myrow[6]></TD>
<TD><a href=$myrow[7]></TD>
</TR>";
}
echo "</table>\n";
?>
</BODY>
</HTML>
how do i make the line "<TD><a href=$myrow[7]></TD>" display a link when something is typed in? so far when something is typed into the form it shows up when i look in the actual database but it doesnt display in this view stock section, how can i make it so that if i type in for example orderitem1.html how can i make it so it makes it a link to click? [img src=\"style_emoticons/[#EMO_DIR#]/huh.gif\" style=\"vertical-align:middle\" emoid=\":huh:\" border=\"0\" alt=\"huh.gif\" /]
-
i need any help/advice i can get, i have tried the larry ulman php book but it doesnt make any sense to me what so ever, i have tried to learn it but i am completely stuck and im using this as a last resort
-
I am doing a college project and have to creat a shop, i can add customers, products and edit/delete but i don not know how to do a basket all i need is a simple and basic basket script.
i have 3 tables
rb_customer
rb_product
rb_order
rb_customer has these fields:
[b]Customer_Number
Title
First_Name
Last_Name
Age
Address_Line_1
Address_Line2
City
County
PostCode
Telephone_Number
E_Mail_Address[/b]
rb_product has these fields:
[b]Item Name
Cost
Postage
Category
In_Stock
Image [/b]
rb_order has:
[b]Order Number
Item Number
Item Name
Cost
Date Ordered
Image [/b]
can anyone help?
PHP database link, show a link?
in PHP Coding Help
Posted