nikesh.yadav commented: nice helper, great hardworker ..... you are +1
i have modified your code..
and its working now:
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password="1234"; // Mysql password
$db_name="opulent_online1"; // Database name
$tbl_name="users"; // Table name
// Connect to server and select databse.
mysql_connect("$host", "$username", "$password")or die("cannot connect");
mysql_select_db("$db_name")or die("cannot select DB");
if($_SERVER['REQUEST_METHOD']=='POST')
{
if(isset($_POST['check_compare']))
{
$sql = "DELETE FROM $tbl_name WHERE find_in_set(uid,'".$_POST['check_compare']."')";
$result = mysql_query($sql);
}
}
$sql="SELECT * FROM $tbl_name";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
?>
<?
// Check if delete button active, start this
?>
<script>
function comparision(){
d=document.form1;
var total="";
if(!d.c.length){
if(d.c.checked) {
d.check_compare.value=d.check_compare.value+d.c.value+',';
return true;
} else {
alert("Please select check Box");
return false;
}
}
for(var i=0; i < d.c.length; i++){
if(d.c[i].checked) {
total +=d.c[i].value + "\n";
d.check_compare.value=d.check_compare.value+d.c[i].value+',';
}
}
if(d.check_compare.value=="") {
alert("Please select atleast one check Box");
return false;
}
}
</script>
<table width="400" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><form name="form1" method="post" action="deleterows.php"onSubmit="return comparision()">
<input type="hidden" name="check_compare">
<table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td bgcolor="#FFFFFF"> </td>
<td colspan="4" bgcolor="#FFFFFF"><strong>Delete multiple rows in mysql</strong> </td>
</tr>
<tr>
<td align="center" bgcolor="#FFFFFF">#</td>
<td align="center" bgcolor="#FFFFFF"><strong>Id</strong></td>
<td align="center" bgcolor="#FFFFFF"><strong>Name</strong></td>
<td align="center" bgcolor="#FFFFFF"><strong>Lastname</strong></td>
<td align="center" bgcolor="#FFFFFF"><strong>Email</strong></td>
</tr>
<?php
while($rows=mysql_fetch_array($result)){
?>
<tr>
<td align="center" bgcolor="#FFFFFF">
<input type="checkbox" name="c" value="<?=$rows['uid'];?>" id="c"/>
</td>
<td bgcolor="#FFFFFF"><? echo $rows['uid']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['name']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['utype']; ?></td>
<td bgcolor="#FFFFFF"><? echo $rows['uemail']; ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="5" align="center" bgcolor="#FFFFFF">
<input name="compbutton" type="submit" class="Button" value="Compare" /></td>
</tr>
</table>
</form>
</td>
</tr>
</table>
or check this attatchment...
hello try this code once:
$photo= imagecreatefromjpeg($image_file);
$fotoW = imagesx($photo);
$fotoH = imagesy($photo);
$photoFrame = imagecreatetruecolor(600,338);
$logoImage = imagecreatefrompng('logo.png');
imagecopyresampled($photoFrame, $photo, 0, 0, 0, 0, 600, 338, $fotoW, $fotoH);
$logoW = imagesx($logoImage);
$logoH = imagesy($logoImage);
imagecopy($photoFrame, $logoImage, 0, 0, 0, 0, $logoW, $logoH);
imagejpeg($photoFrame, '', 100);
Google is Google...
i don't get what you said..
Make me clear...
some thing goes like that....
<table width="30%" border="0" background="some.gif">
<tr>
<td colspan="2" ><? echo $row['name'];?></td>
</tr>
<tr>
<td colspan="2"><? echo $row['identity'];?></td>
</tr>
<tr>
<td ><img src="<?=$row['identity'];?>" /></td>
<td><? echo $row['posts'];?></td>
</tr>
</table>
hello nikesh...
that image having a back ground image is same for all...
and the text (name,posts,solved threads) will coming from database and also an image of ours(avatar)...
i think nothing hard to do this....
i think you can't use a php variable in a html file...
If you want send some value from php file to html file, then put it in hidden variable at php file , and send it to html file..
curd rice...
For web development , dotNet is the best.....
Java is heavily used throughout the industry. It is now open source so does not depend on Sun alone anymore.
Advantage of Java is that it can run anywhere while Microsoft stuff only runs on MS systems.
I am faster than you...
Stupids are increases day by day!!!!!!
"Mistakes increases your experience & Experience decreases your mistakes...You learn from your mistakes, Then other sill learn from your SUCCESS..."
hello, here i have written js code for validating your unit field and radio buttons...
and write remaining code by your self....
<script type="text/javascript">
function formValidator(){
var d=document.valform;
if(trimstr(d.unitnum.value)=="")
{
alert("Please enter a valid unit number");
d.unitnum.focus();return false;
}
if(d.campus1.checked==false && d.campus2.checked==false && d.campus3.checked==false) {
alert("Please check atleast one radio button!!");
d.campus1.focus();
return false;
}
}
function trimstr(str) {
str= this != window? this : str;
return str.replace(/^\s+/g, '').replace(/\s+$/g, '');
}
</script>
hello
try this instead of your 87th line:
if(!empty($_POST['master_id']))
can
any
many
reckoned
undertime
php or dot net
National Treasure
Farmer is a real wise hardworker.
Heat, Ten , Hence...
playstation
sweet.
i never believe in _____________.
-1007
Jamsbond 007
he he he....
collection -> coins collection
then make your thread solved....
select * from table where c_id like '% 4%';
all your code is perfect...
have you specified correct email id....
have you checked your email....
try it again....
have you tested your code at local or ftp????
Thank you very much for your help.
I managed to solve the problem my self.
tel me what your mistake????
please confirm that name(what you typed) is same as name in database....
or post your needed code...
echo $_POST['sel_id'];exit;
see what it prints...
hello dickersonka and pritaeas...
Please give clear explanation about mysql indexing...how to use??
Thanks in advance...
hello anuj..
if you want to store images into your database...
Its very best thing to store image path to database and store image into a folder....
Then retrieve that image whanever you want...
For this follow this tutorial:
http://www.php-mysql-tutorial.com/php-mysql-upload.php