Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

PHP Forum


You are currently viewing our PHP Forum as a guest. Please register to participate.
Login



Freelance Jobs

Reply
solve my php problems.
Old 03-03-2010, 06:32 AM solve my php problems.
Skilled Talker

Posts: 59
Name: elenabush
Trades: 0
please let us know where is prob.

Quote:
<?php
$db_name="ram";
mysql_connect("localhost","root","");
$db=mysql_select_db($db_name);

?>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Branch</title>

<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script type="text/javascript" src="script.js"> </script>
<style type="text/css">
<!--
.style1 {color: #FFFFFF}
-->
</style>
</head>

<body>
<table width="775" border="0" align="center" cellpadding="0" cellspacing="0" bgcolor="#FFFFFF">
<tr>
<td><hr size="1" nosdaeh></td>
</tr>
<tr>
<td>
<form action="" method="post" name="" id="">
<table width="600" border="1" align="center" cellpadding="2" cellspacing="2">
<tr>
<td><input name="topcheckbox" type="checkbox" class="check" id="topcheckbox" onClick="selectall();" value="ON">
Select All </td>
<td colspan="3" align="center"><a href="form.php?mode=add">Add New Branch</a></td>
</tr>
<tr>
<td><strong><a href="javascript:goDel()">Delete</a></strong></td>
<td><strong>Branch Name </strong></td>
<td><strong>Short Name </strong></td>
<td><strong>Update</strong></td>
</tr>
<?

while($row=mysql_fetch_array( $result=mysql_query("select * from tbl_products"))) {
?>
<tr>
<td><input name="<? echo $row['sn']; ?>" type="checkbox" class="check"></td>
<td><? echo $row['branchname']; ?></td>
<td><? echo $row['shortname']; ?></td>
<td><a href="<? echo 'form.php?sn='.$row['sn'].'&mode=update'; ?>">Update</a></td>
</tr>
<? } ?>
<tr>
<td><strong><a href="javascript:goDel()">Delete</a></strong></td>
<td><strong>Branch Name </strong></td>
<td><strong>Short Name </strong></td>
<td><strong>Update</strong></td>
</tr>
</table>
</form></td>
</tr>
</table>
</body>
</html>
__________________

Please login or register to view this content. Registration is FREE
#
Please login or register to view this content. Registration is FREE
#
Please login or register to view this content. Registration is FREE
elena1234 is offline
Reply With Quote
View Public Profile Visit elena1234's homepage!
 
 
Register now for full access!
Old 03-03-2010, 08:34 AM Re: solve my php problems.
wayfarer07's Avatar
Poo on You

Latest Blog Post:
Introducing WowWindow
Posts: 3,987
Name: Abel Mohler
Location: Asheville, North Carolina USA
Trades: 0
and the problem you're having is?
__________________
I build web things. I work for the startup
Please login or register to view this content. Registration is FREE
.
wayfarer07 is offline
Reply With Quote
View Public Profile Visit wayfarer07's homepage!
 
Old 03-03-2010, 11:53 AM Re: solve my php problems.
NullPointer's Avatar
Will Code for Food

Posts: 2,815
Name: Matt
Location: Irvine, CA
Trades: 0
This line:
PHP Code:
while($row=mysql_fetch_array$result=mysql_query("select * from tbl_products"))) 
At each iteration of the while loop this entire line is evaluated. This means that your query is executed and set to the variable $result each time. Try:
PHP Code:
$result=mysql_query("select * from tbl_products");
while(
$row=mysql_fetch_array$result)) 
Also, don't use short tags; use <?php instead of <?

One more thing, as Abel pointed out. Be specific about your problem. What error messages are you getting? What is the expected and actual result of your code?
__________________

Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
|
Please login or register to view this content. Registration is FREE
NullPointer is online now
Reply With Quote
View Public Profile Visit NullPointer's homepage!
 
Reply     « Reply to solve my php problems.
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.55893 seconds with 12 queries