nav33n 472 Purple hazed! Team Colleague Featured Poster

Generation of electricity will be a very tough task in future.

nav33n 472 Purple hazed! Team Colleague Featured Poster

If you have phpmyadmin, click on the "export" tab. Select "Microsoft Excel 2000", check the "Save as file" option. Then click on "Go".

nav33n 472 Purple hazed! Team Colleague Featured Poster

It works for me though! But anyway, try the following.

$checkbox=$_POST['checkbox'];
for($i=0;$i<count($checkbox);$i++){
$del_id = $checkbox[$i];
.......
nav33n 472 Purple hazed! Team Colleague Featured Poster

hi
this works but how to get the dropwown value in the next page..
i tried with $id=$_REQUEST; but this is not working
<form method="get" action="sort2.php">
<?php
$hostname = "localhost";
$username = "";
$password = "";
$dbid = "";
$link=mysql_connect($hostname, $username, $password);
mysql_select_db($dbid) or die("unable to connect");

$sql="SELECT id,name FROM personal";
$result=mysql_query($sql);

?>
<table>

<tr>
<td>Splendor Id</td><td><select name="Names">
<?php

while($rows=mysql_fetch_array($result))

{
echo"<option value=".$rows[0].">". $rows[1]."</option>";
}

mysql_close();
?>


</select></td>
</tr>
<tr>
<td>From</td><td><input type="text" name="from"></td>
<td>To</td><td><input type="text" name="to"></td>
<td><input type="submit" name="submit" value="submit"></td></tr>

</table>
</form>

$id=$_REQUEST should be $id=$_REQUEST

And Please, next time you post your code, place it within [ code] ... [ / code] tags !

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can do something like tirivamwe has mentioned. Or you can use a function so that you can reuse the code whenever you want.

<?php
$conn=mysql_connect("localhost","root");
mysql_select_db("test");
function dropdown($colname,$tablename){
	$query="select ".$colname." from ".$tablename;
	$result=mysql_query($query);
	$option="";
	while($row=mysql_fetch_array($result)){
		$option.="<option value=".$row[0].">".$row[0]."</option>";
	}
	return $option;
}
?>
<html>
<body>
<form>
<select name='test'>
<?php echo $options=dropdown("Column_name","Table_name"); 
//the column name of table_name which you want to display in the options 
 ?>
</select>
<select name='test1'>
<?php echo $options=dropdown("Column_name1","Table_name2"); 
 ?>
</select>
</form>
</body>
</html>
nav33n 472 Purple hazed! Team Colleague Featured Poster

Uploading a file. And what do you mean by send the file to a private link ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

polute ? What do you mean by that ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

you are welcome :)

nav33n 472 Purple hazed! Team Colleague Featured Poster
<?php
$host="localhost"; // Host name
$username="root"; // Mysql username
$password=""; // Mysql password
$db_name="forum"; // Database name
$tbl_name="test_mysql"; // 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");

$sql="SELECT * FROM test_mysql";
$result=mysql_query($sql);

$count=mysql_num_rows($result);

?>
<table width="400" border="0" cellspacing="1" cellpadding="0">
<tr>
<td><form name="form1" method="post" action="">
<table width="400" border="0" cellpadding="3" cellspacing="1" bgcolor="#CCCCCC">
<tr>
<td bgcolor="#FFFFFF">&nbsp;</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, MYSQL_ASSOC)){

?>
<tr>
<td align="center" bgcolor="#FFFFFF"><input name="checkbox[]" type="checkbox" id="checkbox[]" value="<? echo $rows['id']; ?>"></td>
<td bgcolor="#FFFFFF"><?php echo $rows['id']; ?></td>
<td bgcolor="#FFFFFF"><?php echo $rows['name']; ?></td>
<td bgcolor="#FFFFFF"><?php echo $rows['lastname']; ?></td>
<td bgcolor="#FFFFFF"><?php echo $rows['email']; ?></td>
</tr>
<?php
}
?>
<tr>
<td colspan="5" align="center" bgcolor="#FFFFFF"><input name="delete" type="submit" id="delete" value="Delete"></td>
</tr>
<?php
// Check if delete button active, start this
if($_POST['delete']){
//print_r($_POST);
//exit;
for($i=0;$i<count($_POST['checkbox']);$i++){

$del_id = $checkbox[$i];

$sql = "DELETE FROM $tbl_name WHERE id='$del_id'";
$result = mysql_query($sql);
}

// if successful redirect to delete_multiple.php
if($result){
echo "<meta http-equiv=\"refresh\" content=\"0;URL=h_delete.php\">";
}
}
mysql_close();
?>
</table>
</form>
</td>
</tr>
</table>

This should work.

Cheers,
Nav

nav33n 472 Purple hazed! Team Colleague Featured Poster

just add another condition ! SELECT * from attend where (day1 between '$from' and '$to') and spid='$id' :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

What is the problem actually ? Because the OP wasn't asking for any help !

Hi Designer,
I'm not actually asking for help here, I've posted this as a solution to the problem I posed here and in other posts. The above code works successfully.

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) you are welcome!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Ok. I see the error. Its your select_db string. mysql_select_db("kishou_website", $connect);/ Its after your query. Put it above the query. :) This should fix it.

kishou commented: just keeps on helping! +1
nav33n 472 Purple hazed! Team Colleague Featured Poster

That means there are many records with the same spid. You can change the above query to, select email from personal where spid IN (select spid from applyleave where leaveid IN (select leaveid from viewleave where leaveid="specify your leaveid here")) Cheers.

nav33n 472 Purple hazed! Team Colleague Featured Poster

yea dont copy it though. please.

Dude! I can write my own script.. :D Anyway, here is the error.. $res=mysql_query("SELECT * FROM mailing_list where Email=$_POST[email]"); This should have been $res=mysql_query("SELECT * FROM mailing_list where Email='".$_POST[email]."'"); You should put your variable name in single quote if its a string.

Cheers,
Nav

nav33n 472 Purple hazed! Team Colleague Featured Poster

Can you show us your script ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yep.. Can you show us the code ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

thanks dude! So then it would look like this?

$res=mysql_query("SELECT * FROM registered_members=$_POST['Username']");
if (mysql_num_rows($res)>0)
{
echo "Username is already taken!";
}
else
{

ok then i get this error:
Warning: mysql_num_rows(): supplied argument is not a valid MySQL result resource.

Thats because, you have your query wrong. Its missing a where clause. $res=mysql_query("SELECT * FROM registered_members where username=$_POST['Username']");

nav33n 472 Purple hazed! Team Colleague Featured Poster

Inevitable is a song by Shakira.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Sir, the water cannot be the same. The only thing "same" about it is the fact that its 1 O + 2 H. The pollutants/contaminants will obviously differ in scale and nature by environment. You also have to consider the method each country uses to filter out the water. Also, desalinated water is certainly not the same as filtered fresh water.

Don't call people ignorant when you don't act any better

EDIT: Oops...Leave it to me to try and drink carbondioxide

India "was" a land of villages and it has changed over time. Well, who knows it better than the people living here. Bah!

Back to the topic: I am drinking water without even boiling it. Oh btw, I have been drinking this water for umm.. 24 yrs and i am still safe and healthy ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb. But this isn't the right forum to ask your question. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

spot death is an interesting way of saying instant death.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Deer is a cute animal. But it should have had stripes on it instead of spots.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome! Only 50 with 500 mb. I find that hard to believe seeing as I can fit about 200 on 500 mb.

It all depends on the bitrate of the mp3 file.

@cjk93, Welcome to daniweb.

nav33n 472 Purple hazed! Team Colleague Featured Poster

select email from personal where spid=(select spid from applyleave where leaveid=(select leaveid from viewleave where leaveid="specify your leaveid here")) Hi.. Try this and let me know if this works..

nav33n 472 Purple hazed! Team Colleague Featured Poster

select idtransaction, customerID,debit, credit, (debit - credit) as balance, transDate from transaction where customerID='Cust001' ? Is that what you are talking about ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) thats a good one !

nav33n 472 Purple hazed! Team Colleague Featured Poster

I doubt it's the same water...

How is it different from the water you drink ? The water we drink has no color, no smell and i believe, has the same characteristics of normal water.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Oh.. let me clarify that for you. The water we drink here is totally safe and clean :) TBH, its much safer and tastier than mineral water !

nav33n 472 Purple hazed! Team Colleague Featured Poster

For aggregate functions like SUM, AVG, MIN, MAX etc, you should use group by clause. Group by clause groups the records depending upon the table field you mention. Say, for eg, you have a table. This table has 2 columns, student_marks and subject. You want to know the average marks of each subject. You can do this using the group by clause. select avg(student_marks) from table group by subject This will calculate the average marks of each subject and shows the average marks for each subject.
Cheers,
Nav

nav33n 472 Purple hazed! Team Colleague Featured Poster

All you need is Wamp. Just install wamp and it will configure apache, mysql and php for you :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

You live in India and drink the water, isn't that dangerous? I hope you boil it thoroughly first.

Why would it be dangerous ? Its the same water what everyone drinks. (I am not talking about the mineral water in bottles!)

nav33n 472 Purple hazed! Team Colleague Featured Poster

True, true....Besides, I hate to shake things up but some guys in here sure are 'meany'....:(

By the way, nav33n, I've done my homework....BY MYSELF....shish :@

:P Good job!

nav33n 472 Purple hazed! Team Colleague Featured Poster

This thread was started more than an year ago and the OP, after starting this thread has never come back ! :-/

nav33n 472 Purple hazed! Team Colleague Featured Poster

There's a query that does this for you .. :)

select * from tablename order by rand() limit 5

I didn't know that ! thanks :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

How will it make any difference ? If someone hacks into your database, how will changing its name makes it 'unhackable' ? The hacker will access/delete the tables with the loopholes in your script. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Your wish has been granted, but Santa Claus has brought everyone an oxygen generator.

I wish there would be an honest politician!

Your wish has been granted, but all the tax payers and non-tax payers are now corrupted.

nav33n 472 Purple hazed! Team Colleague Featured Poster

I wish there would be no oxygen.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome to Daniweb!

nav33n 472 Purple hazed! Team Colleague Featured Poster

I wish all these people(new programmers and sick people who aren't sick anymore) suffer from amnesia!

nav33n 472 Purple hazed! Team Colleague Featured Poster

I know ! I was talking about your response time. :P

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) that was quick. cool..

nav33n 472 Purple hazed! Team Colleague Featured Poster

But are you wearing the Daniweb(TM) specially patented bad word filter glasses? I think not!

Oh damn :( Dani didn't give me any. And I don't wanna steal yours. :P

nav33n 472 Purple hazed! Team Colleague Featured Poster

The bad words filter now works on the reputation system.

I can still see the F word in the reputation for this post :P

nav33n 472 Purple hazed! Team Colleague Featured Poster

:) cool !

nav33n 472 Purple hazed! Team Colleague Featured Poster

I wonder how did you dig out that old thread. The question was asked 3 years ago. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Anyone care to define sub-human?

Definitions of subhuman on the Web:

* less than human or not worthy of a human being; "treated natives as subhuman"; "a subhuman spectacle"; "the subhuman primates"
* unfit for human beings; "subhuman conditions of life".

P.S It really doesn't make any difference if you don't care.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Beat me in this game and I ll give you 10 bucks.