12 1894
semicolon missing in line 17.,
try applying it. -
$row = mysql_fetch_assoc($result);
-
SOlved it. wrote msg="...." instead of $msg="..."
Thanks....
yeah., u missed '$' symbol there .,
thanks
Thanks to you too for paying kind attention. will come back if got stuck anywhere.
mysql_fetch_assoc() expects parameter 1 to be resource at line 58... Please help -
<?php
-
session_start();
-
if($_SESSION['UID'])
-
{
-
if($_SESSION['RGT'] == "R")
-
header("location:NoAccess.php");
-
}
-
else
-
header("location:NoAccess.php");
-
$message="";
-
$username="root";
-
$password="";
-
$database="lko_phone";
-
$host="localhost";
-
mysql_connect($host,$username,$password);
-
@mysql_select_db($database);
-
?>
-
<html>
-
<head>
-
<title>Delete Employee Record</title>
-
</head>
-
<body background="Images/Back5.jpg" text="white" link="white" alink="white" vlink="white">
-
<center>
-
<table background="Images/Back10.jpg" width="100%" border="0">
-
<tr>
-
<td><img src="Images/Logo.JPG"></td>
-
<td align=center><font face="courier new" size="5" color="orange"><strong>Welcome To: LKO - TelWin</strong></font>
-
<br><font face="courier new" size="2" color="yellow">Online Telephone Address Book/Call-Register Maintenance</font></td>
-
<td align=right>
-
<?php
-
$welcome=$_SESSION['UID'];
-
if(strcmp($welcome,"mbchaudhuri")==0)
-
{
-
$query = sprintf("SELECT * FROM notes");
-
$result=mysql_query($query);
-
$num=mysql_num_rows($result);
-
$message=sprintf("<font face=verdana color=aqua size=2>You have :<strong>".$num." Notes to see</strong></font><br>");
-
}
-
else
-
$message="";
-
echo "<font face=verdana size=2 color=yellow>Welcome: ".$welcome."<br>";
-
echo "<font face=verdana color=orange size=2>Today is :<strong>".date("d-M-Y, l")."</strong></font><br>";
-
echo $message;
-
echo "<a href=Logout.php>Logout</a>";
-
?>
-
</table>
-
</center>
-
<form action=SearchEmployee.php>
-
<h2>Deleted the following employee record..<?php echo $_POST['esrl']?></h2>
-
<?php
-
if($_POST && !empty($_POST['Delete']))
-
{
-
$r=$_POST['esrl'];
-
$query=sprintf("select * from employee where srl = $r");
-
echo $query;
-
$result=mysql_query($query);
-
-
while($row = mysql_fetch_assoc($result))
-
{
-
echo "<br><strong>Employee Name:".$row['ename'];
-
echo "<br>Designation :".$row['desig'];
-
echo "<br>Department :".$row['dept'];
-
echo "<br>Direct No :".$row['d_no'];
-
echo "<br>Extension :".$row['extn'];
-
echo "<br>Mobile No :".$row['mobile'];
-
echo "<br>Residential :".$row['res_no'];
-
echo "<br>Other Contact:".$row['other_no'];
-
echo "</strong>";
-
}
-
echo mysql_error();
-
echo "<br><br><input type=submit value='Back to search page' >";
-
mysql_query("delete from emloyee where srl=$r");
-
}
-
-
?>
-
</form>
-
</body>
-
</html>
-
Yep.. solved the problem. I changed the code as follows: -
$query="select * from employee where srl ='". $r."'";
-
$result=mysql_query($query);
-
while($row = mysql_fetch_assoc($result))
-
{
-
echo "<br><strong>Employee Name:".$row['ename'];
-
echo "<br>Designation :".$row['desig'];
-
echo "<br>Department :".$row['dept'];
-
echo "<br>Direct No :".$row['d_no'];
-
echo "<br>Extension :".$row['extn'];
-
echo "<br>Mobile No :".$row['mobile'];
-
echo "<br>Residential :".$row['res_no'];
-
echo "<br>Other Contact:".$row['other_no'];
-
echo "</strong>";
-
}
-
$query="delete from employee where srl ='". $r."'";
-
mysql_query($query);
-
Now working perfectly. I do not why it is taking string value, but, in table it srl is defined as integer.
you pass srl as a string. (omit the ')
I just want to display three columns in one row. But, when value of $i is 1 or 4, the statements under if is firing. Dont know why it is happening, and how to solve it. -
$i=0;
-
while ($row = mysql_fetch_assoc($result))
-
{
-
if(($i%3)==0)
-
{
-
echo "<tr>";
-
echo "<td><input type=radio name=JobNo value=".$row['job_no']." />"</td>";
-
echo "<td><font face=verdana size=2>".$row['job_no']."</font></td>";
-
echo "</tr>";
-
}
-
else
-
{
-
echo "<td><input type=radio name=JobNo value=".$row['job_no']." />"</td>";
-
echo "<td><font face=verdana size=2>".$row['job_no']."</font></td>";
-
}
-
-
$i=$i+1;
-
}
-
OK got it.... <tr> and </tr> is firing for only one column...... Sorry for the sily question.
This code removed the problem.... -
<center><table border="1" bordercolor="orange">
-
<tr>
-
<td bgcolor="black"> </td>
-
<td bgcolor="black"><font color="orange" face="verdana" size="2"><b>Job Number</b></font></td>
-
<td bgcolor="black"> </td>
-
<td bgcolor="black"><font color="orange" face="verdana" size="2"><b>Job Number</b></font></td>
-
<td bgcolor="black"> </td>
-
<td bgcolor="black"><font color="orange" face="verdana" size="2"><b>Job Number</b></font></td>
-
<?php
-
$query = sprintf("SELECT * FROM job order by job_no");
-
$result=mysql_query($query);
-
$i=3;
-
-
while ($row = mysql_fetch_assoc($result))
-
{
-
if(($i%3)==0) echo "</tr><tr>";
-
-
echo "<td><input type=radio name=JobNo value=".$row['job_no']." />->".($i%3)."</td>";
-
echo "<td><font face=verdana size=2>".$row['job_no']."</font></td>";
-
-
$i=$i+1;
-
}
-
mysql_free_result($result);
-
echo "</tr>";
-
?>
-
</table>
-
Sign in to post your reply or Sign up for a free account.
Similar topics
by: dave |
last post by:
Hi,
I know i shouldn't work on php forms when i'm going on 30 hours of no sleep,
but i did anyway. I'm trying to get the below to work, and i keep getting a
parse error line 74, an unexpected
','...
|
by: Salim |
last post by:
Hi people, keep getting this errorParse error: parse error, unexpected
T_STRING in order_fns.php line 91. the code is below for the file and
I've indicated line 91
<?php
function...
|
by: urmyfriend |
last post by:
Hi,
I am getting the parse error while i try to execute a simple sql query in postgres.
java.sql.SQLException: ERROR: parser: parse error at or near "and" at character 58
The Query has...
|
by: kestrel |
last post by:
I have some html code that is supposed to be displayed by php echo. But for some reason i keep getting a syntax error, and i cant figure out what is going on.
Heres what i have
<?php...
|
by: DavidPr |
last post by:
I'm getting - parse error, unexpected T_LNUMBER - error messages referring to the last "if" lines of this code.
What I'm trying to do is check the database and if this user's article row isn't...
|
by: Lawrence Krubner |
last post by:
Imagine a template system that works by getting a file, as a string, and
then putting it through eval(), something like this:
$formAsString = $controller->command("readFileAndReturnString",...
|
by: JRough |
last post by:
On Sep 26, 3:23 pm, Captain Paralytic <paul_laut...@yahoo.comwrote:
without the exit I get this again:
Warning: Cannot modify header information - headers already sent by
(output started at...
|
by: micky125 |
last post by:
Lo all,
Ive been getting the error message
Parse error: parse error, unexpected T_ENCAPSED_AND_WHITESPACE, expecting T_STRING or T_VARIABLE or T_NUM_STRING in /home/moneill/public_html/input.html...
|
by: angelicdevil |
last post by:
i have 2 tables 1 is status_type with field name status and other is users with field username and status
now i want that the first listbox lists all status from status type ( this i have achieved...
|
by: angelicdevil |
last post by:
i m trying to display a message based on code status against the code in the database for on the code entered.
however it gives me a parse error
<?php require_once("includes/functions.php"); ?>...
|
by: Charles Arthur |
last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
|
by: emmanuelkatto |
last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud.
Please let me know.
Thanks!
Emmanuel
|
by: nemocccc |
last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
|
by: Sonnysonu |
last post by:
This is the data of csv file
1 2 3
1 2 3
1 2 3
1 2 3
2 3
2 3
3
the lengths should be different i have to store the data by column-wise with in the specific length.
suppose the i have to...
|
by: Hystou |
last post by:
There are some requirements for setting up RAID:
1. The motherboard and BIOS support RAID configuration.
2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
|
by: Hystou |
last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
|
by: Oralloy |
last post by:
Hello folks,
I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>".
The problem is that using the GNU compilers,...
|
by: tracyyun |
last post by:
Dear forum friends,
With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
|
by: agi2029 |
last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
| |