nav33n 472 Purple hazed! Team Colleague Featured Poster

Welcome back serkan :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Definitely there is no potential danger, but as time pass this thread will go down the memory line. Once it goes pas t the 2nd page i don't think anyone will ever open it unless someone runs a search with specific key words.

Agree with that. But I guess, we don't have an option to publish articles here. Anyways, Cheers man :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

I am facing Torjan virus when i used net it come with in one minute anybody can help me in this regard i will be very thankful.

Post your question in this forum specifying all the details of your computer/operating system etc.

@Mad hatter,
Get over with your linux obsession. It's not doing any good to anyone.

nav33n 472 Purple hazed! Team Colleague Featured Poster

When the user submits the page, build your query depending upon the user's selection.
If the user has selected from_year and to_year, include that in your condition and so on.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Wow! This thread is unbelievable and you guys are mind blowing! :P

nav33n 472 Purple hazed! Team Colleague Featured Poster

:( No. I pay around Rs. 1200 (approx $26) for my 512kbps connection. Its around Rs. 3000 for 1 mbps (that is approx $65).

nav33n 472 Purple hazed! Team Colleague Featured Poster

Cool ! Congrats :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hi, I am not sure how you are validating what mysql returns. In php, when you query the table, for example,

//query the table with username and password 
$query = "select * from table where username='test' and password='test'";
//execute the query and save the resource in $result. 
$result = mysql_query($query);
//If the variable $result is true and if the query returns more than 0 rows, (meaning, there is a record!) then display convenient message.
if(mysql_num_rows($result) > 0) {
 echo "Username and password exists!";
} else {
//else, no records exist
 echo "No records found.";
}

In php however, this will return false if a record doesn't exist in the table. If it has a record, then it will return all the columns of that record as a resource.
I am not sure about Java, but I think mysql will return an empty result set if no records are found.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hi, can you elaborate your question ?
If you are inserting the value to the table from php, you can use substr to insert only a part of a string. If you are directly inserting the record to the table, you can use mysql's substring function.
If this solves your problem, well and good.. If it doesn't, please explain your question in detail.
P.S you can only edit your post within 30 mins of posting! :)

Cheers!

nav33n 472 Purple hazed! Team Colleague Featured Poster

The quality is okay. The seek bar doesn't work though. And since it doesn't work, it's difficult to know the duration of the video (and go forward or backwards). But, overall, thumbs up for the effort.
(One suggestion. If you also provide the source code along with the tutorial, it would be good).
Eg. http://www.phpvideotutorials.com/lesson02/

nav33n 472 Purple hazed! Team Colleague Featured Poster

Well, she has her priorities, do you really need to 'fix' something that nobody will click anyway? Removing the link would require more code, not less.

I know she has her priorities (Its been a week since I posted this thread and haven't got her reply. So, I know she's busy). Moreover, that was just a suggestion (it's `daniweb community feedback`, isn't it ?) not an order.
Lastly, removing the link wouldn't need more than 2 lines of code (maybe less).

$html = ($post_currently_negative=="0") ? "No hyperlink" : "Show hyperlink";

:)

nav33n 472 Purple hazed! Team Colleague Featured Poster

I guess Dani assumes that you have enough common sense to not click a link which will obviously get no results :)

:) My point exactly. Why do you need something which don't yield any result ? It's not about assuming (or not assuming) something.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You are almost there! I have modified your code, very small changes.

<?php
if(isset($_POST['submit'])) {
	for($i=1;$i<=$_POST['count'];$i++) {
		$textfieldname = "marquee_".$i;
		print $_POST[$textfieldname];
		print "<br />";
	}
}
?>
<html>
<head>
 
<script language="javascript" type="text/javascript"> 
 
    function addField() { 
    var tbody = document.getElementById("tblBody"); 
    var ctr = tbody.getElementsByTagName("input").length + 1; 
    var input; 
   
    if ( ctr > 15 ) { 
          alert ("If you want to tell the whole world, dont do it all at once please"); 
    }else{ 
   
        if (document.all){ //input.name doesn't work in IE 
            input = document.createElement('<input name="field_'+ctr+'"> x <input name="field_'+ctr+'">'); 
        }else{ 
            input = document.createElement('input'); 
            input.name = "marquee_"+ctr; 
        } 
  
        input.id = input.name; 
        input.type = "text"; 
        input.value = ""; 
        input.className = "textfield"; 
        var cell = document.createElement('td'); 
        cell.style.height = '30px'; 
        cell.appendChild(document.createTextNode(ctr+". ")); 
        cell.appendChild(input); 
        var row = document.createElement('tr'); 
        row.appendChild(cell); 
        tbody.appendChild(row); 
   		document.getElementById('count').value = ctr;   
    } 
}  
</script> 
</head>  
 
 
<body> 
 
 
 
 
    <form name="the_form" id="the_form" method="post" action=""> 
     	<input type="hidden" name="count" id="count">
          <table width="100%"  border="0" cellspacing="0" cellpadding="0"> 
          <tbody id="tblBody"> 
            <tr> 
              <td height="30"> 
                1. <input name="marquee_1" type="text" class="textfield" id="field_1" /> 
              </td> 
            </tr> 
            <tr> 
              <td height="30"> 
                2. <input name="marquee_2" type="text" class="textfield" id="field_2" /> 
              </td> 
            </tr> 
            <tr> 
              <td height="30"> 
                3. <input name="marquee_3" type="text" class="textfield" id="field_3" /> 
              </td> 
            </tr> 
            
             
        </tbody>
        </table> 
          <input name="add" type="button" class="button" id="add" value="Add Another" onClick="addField();"/>           
			<input type="submit" name="submit" value="Get Components" />
           
    </form>
    </body>
    </html>

(P.S. If count value is empty, then it means, 'Add another' button wasn't clicked and no fields were added).

nav33n 472 Purple hazed! Team Colleague Featured Poster

I was solved the problem.
Don't know why I can't use Index as my field in database, after I changed my field name then no problem already. Thanks for helping. :)

FYI, index is a mysql reserved keyword. If at all you want to use them, you should use `, like, `index`. I personally don't prefer using reserved keywords.
Here is a list of reserved keywords.

nav33n 472 Purple hazed! Team Colleague Featured Poster

http://dev.mysql.com/doc/refman/5.1/en/innodb-foreign-key-constraints.html Check for foreign key constraints, primary key, foreign key in google.

From the above link:
InnoDB rejects any INSERT or UPDATE operation that attempts to create a foreign key value in a child table if there is no a matching candidate key value in the parent table.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Okay, one more suggestion.

Why should 0 be a hyperlink in this case ?

Posts Currently Negative: 0

Clicking that leads to nowhere. It says,

Sorry - no matches. Please try some different terms.

Look at niek_e's profile for example.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Yeah. Don't forget to study.

:D I passed with flying colors already.

nav33n 472 Purple hazed! Team Colleague Featured Poster

case solved. The site was down. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Ah! that explains it. Thanks for your quick response Dani. Cheers!

nav33n 472 Purple hazed! Team Colleague Featured Poster

test ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

ckeditor ? Hmm.. Haven't tried it. Anyways, goodluck man. Cheers!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Pretty simple. Fetch the data from the database and place it between <textarea> tags. Here is an example.

<?php
if(isset($_POST['save'])) {
	print "<pre>";
	print_r($_POST);
	print "</pre>";
}
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Full featured example</title>

<!-- TinyMCE -->
<script type="text/javascript" src="../jscripts/tiny_mce/tiny_mce.js"></script>
<script type="text/javascript">
	tinyMCE.init({
		// General options
		mode : "textareas",
		theme : "advanced",
		plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount",

		// Theme options
		theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect",
		theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor",
		theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",
		theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_statusbar_location : "bottom",
		theme_advanced_resizing : true,

		// Example content CSS (should be your site CSS)
		content_css : "css/content.css",

		// Drop lists for link/image/media/template dialogs
		template_external_list_url : "lists/template_list.js",
		external_link_list_url : "lists/link_list.js",
		external_image_list_url : "lists/image_list.js",
		media_external_list_url : "lists/media_list.js",

		// Replace values for the template plugin
		template_replace_values : {
			username : "Some User",
			staffid : "991234"
		}
	});
</script>
<!-- /TinyMCE -->

</head>
<body>

<form method="post" action="live_example.php">
	<div>
		<h3>Full featured example</h3>

		<p>
			This page shows all available buttons and plugins that are included in the TinyMCE core package.
			There are more examples on how to use TinyMCE in the <a href="http://wiki.moxiecode.com/examples/tinymce/">Wiki</a>.
		</p>

		<!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded -->
		<div>
			<textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%">
<?php
$con = mysql_connect("localhost","root");
mysql_select_db("test_cms");
$query = "SELECT * FROM category where ct_id=1";
$result = mysql_query($query);
$row = mysql_fetch_assoc($result);
$contents = $row['ct_description'];
echo $contents;
?>
			</textarea>
		</div>

		<!-- Some integration calls -->
		<a href="javascript:;" onmousedown="tinyMCE.get('elm1').show();">[Show]</a>
		<a href="javascript:;" onmousedown="tinyMCE.get('elm1').hide();">[Hide]</a>
		<a …
nav33n 472 Purple hazed! Team Colleague Featured Poster

Great! That would solve around 80% of the question asked by the members! Good luck..

nav33n 472 Purple hazed! Team Colleague Featured Poster

Thats awesome! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Is that all of the error_reporting need to change to "error_reporting = E_ALL & ~E_NOTICE"?

Just now I didn't restart, now I restart already. It does not have the error already. But it still connect to "Please Enter Index and Association Name Completely" although I typed the index and name.

Since you aren't seeing the notices anymore, you have solved that problem. The other 'problem' you are talking about is a user defined error message. That simply means, you have written the logic wrong. I don't have enough time to go through your code, so I can only comment on it later.

What does "error_reporting = E_ALL & ~E_NOTICE" means?

This simply tells the php parser to report all the errors ~(negating or excluding) notices.

nav33n 472 Purple hazed! Team Colleague Featured Poster

What did you change ? php.ini or your script ?
If you are talking bout php.ini, did you restart your server ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

Notices are not errors. If you try to use a variable without initializing it, you will get a notice. To disable notices, edit your php.ini and set error_reporting as,

error_reporting = E_ALL & ~E_NOTICE

This will show all the errors except notices.
But, if you want fix these notices, initialize every variable to null or 0 before using it.

nav33n 472 Purple hazed! Team Colleague Featured Poster

I would still think about encrypting my password. :) Anyways, Congrats and good luck.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Umm.. I am not 100% sure if that is how you are supposed to write a query in java. As far as I can see, there is no need to use trigger in your case and its better you post your question in java forum to get satisfactory response :)
Before you post your question in java forum, do a quick google on mysql insert in java . :)

Oh, btw, for better response, please use code tags next time you post your code.

Cheers,
Naveen

nav33n 472 Purple hazed! Team Colleague Featured Poster

Can you explain how you are storing these values in the table ? Here is a simple example of what I am talking about. Its in php, but I am sure its not completely different from java.

<?php
if(isset($_POST['submit'])) {
	$starttime = $_POST['starttime'];
	$endtime = $_POST['endtime'];
	$duration = $endtime - $starttime;
	$query = "insert into table (starttime,endtime,duration) values ('$starttime','$endtime','$duration')";
	mysql_query($query);
}
?>
<html>
<body>
<form method='post'>
Starttime: <input type='text' name='starttime' /><br />
Endtime: <input type='text name='endtime' /><br />
<input type='submit' name='submit' value='submit'>
</form>
</body>
</html>

What it does is, it shows a form where the user can enter the starttime and endtime. Then, when he clicks on submit, it calculates the difference between endtime and starttime and inserts all these 3 values in the table.
I hope this is clear.
P.S. I am considering you enter both starttime and endtime at the same time. (If not, please mention how you are inserting/etc).

nav33n 472 Purple hazed! Team Colleague Featured Poster

Try this.

$query = "select * from table where Concat( column1, ' ', column2 )
LIKE '%".$search."%'";

This will return all the rows from the table where column1 concatenated with column2 matches $search.
eg.

SELECT *
FROM master_table
WHERE Concat( firstname, ' ', lastname )
LIKE '%alli gator%'
nav33n 472 Purple hazed! Team Colleague Featured Poster

I want to fill that third column(duration) when I insert the values to the first 2 columns..

Why don't you calculate the difference between starttime and endtime and insert the difference while inserting values to the first 2 columns ?
I haven't used triggers myself, but I think its unnecessary to use trigger in this case.

nav33n 472 Purple hazed! Team Colleague Featured Poster

how do i select a row in a table columns i dont know the name of(and find the name of it)? but i know the cell/field of the column has a value of "55"
i also have to EXCLUDE ONE COLUMN that i know the name of.

does anyone know how to make the select statement that seleects all the columns with the value of 55. i only know the name of the column i want to exclude from the search.
?

I am not sure if I understood your question right. As far as I understand your question,
1. you can't select a record/row from the table without knowing the column you are querying on. You should know the column name.
ie.,

$query = "select * from locations where location_name = 'utopia'";

2. If you want to exclude a column from your retrieved result, use only those columns which you want to use. (This is helpful when you have huge queries and horrible execution time).
ie.,

$query = "select  country, pincode from locations where location_name='utopia'";
nav33n 472 Purple hazed! Team Colleague Featured Poster

We are getting close. When I put this code in my site and run it from the webpage it doesn't work properly. What happens is it opens google.com in a very tiny window where the "Click" button was. I don't want a pop up window but rather have it load google.com full size in the current window.

I don't know if this makes a difference but I'm inserting the code as a Widget in iWeb 09.

It works as it is. I haven't used iweb09, so I don't have the slightest clue :(
If you post your relevant code, maybe someone who has experience on iweb 09 can help you out!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Interesting! ;)

Excellent!

You made it to Speed Level 4 (out of 5)

58 out of 70 correct

nav33n 472 Purple hazed! Team Colleague Featured Poster

What is the problem ? You would be selecting CourseName and courseID. So, when you post the form, You will have "MATHS" in $_POST and "101" in $_POST. Then it is all about the insert query.
Or am I missing something ? :-/

nav33n 472 Purple hazed! Team Colleague Featured Poster

The variables $table and $suburb will be empty when the page is first loaded. They will only populated once the form has been submitted - whatever other problems there may be, I think this should be avoided by using an if statement to check that the form has been submitted before executing any other code.

:) Thanks for waking me up. That is absolutely right.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Go to mysql console and create a new user either by following http://dev.mysql.com/doc/refman/5.1/en/adding-users.html OR go to phpmyadmin -> mysql database -> user table. Add a record there filling suitable fields and giving relevant privileges.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Well, I guess your server is a linux box. I dunno bout linux since I work on windows. And you can do a simple test this way.

<?php
$connection=mysql_connect("hostname","username","password");
echo $connection;
?>

If it prints a resource id, then you can connect to mysql. Another way to check if mysql is configured is, by using phpinfo function.

<?php
phpinfo();
?>

run this script. Search for mysql. If it says, mysql support enabled, then mysql is configured.

:)

iamthwee commented: C:\PHP\ext\ - does that look like a typical linux path? No. -2