nav33n 472 Purple hazed! Team Colleague Featured Poster

I decided to do a google search for linear intersections in python programming, after posting here: and came across this. I found it odd, cause I have never seen that page until just a bit ago and noticed that the post is identical to mine down to a type in the first part of the post. I was curious if that site was a back up to this one or something.

Is it just coincidence that you (Trav580) and that site <SNIPPED> have something in common ? :)
Someone has a lot of free time, I suppose. Even this thread is copied!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hmm.. It has to! Did you use error console to see the error message ? If you can post your complete code, we could see where you are going wrong.

nav33n 472 Purple hazed! Team Colleague Featured Poster

:icon_redface: After numerous attempts, I found out the solution. Here it is.

INSERT INTO a (name, age, postcode, city ) 
SELECT name, age, postcode, city 
FROM b where counter = 1
AND NOT 
EXISTS ( 
SELECT *
FROM c
WHERE counter = ( 
SELECT  c_id
FROM d
WHERE counter =  '3'))

Thanks for looking ;)

peter_budo commented: Thanx for sharing +17
nav33n 472 Purple hazed! Team Colleague Featured Poster

You forgot to remove with(form) :)


Edit: For testing purpose, you can use error console in mozilla firefox to know where the error is.

nav33n 472 Purple hazed! Team Colleague Featured Poster

This is the code for the form input:

<select name="grades" size="5" multiple id="grades">
                          <option  value="Pre K">Pre K</option>
                          <option  value="Kindergarten">Kindergarten</option>
                          <option  value="1st">1st</option>
                          <option  value="2nd">2nd</option>
                          <option  value="3th">3rd</option>
                          <option  value="4th">4th</option>
                          <option  value="5th">5th</option>
                          <option  value="6th">6th</option>
                          <option  value="7th">7th</option>
                          <option  value="8th">8th</option>
                          <option  value="9th">9th</option>
                          <option  value="10th">10th</option>
                          <option  value="11th">11th</option>
                          <option  value="12th">12th</option>
                        </select>

Since there is an option to select multiple answers, I would like for all of the answers to be recorded in the database however, the only answer it posts it the last of the group. for example say 6th, 7th, and 8th were all selected. When the form is submitted, only "8th" gets posted to the correct field. Does that make sense?

Use array. Ie.,

<select name="grades[]" size="5" multiple id="grades">

Then, as usual, use foreach($_POST['grades'] as $value) to get each of the selected value.

nav33n 472 Purple hazed! Team Colleague Featured Poster

What is with(form) ? Are you calling a function called with which is declared somewhere else ?
Also, agreement.value.checked wouldn't work because,

  • The syntax is not correct
  • It will say agreement is not defined!

Try this.

function validate(form) {
  if(!(form.agreement.checked)) {
	  alert("Please commit the agreement to continue.");
	  form.agreement.focus();
	  return false;
  } else return true;
}

Same thing for your second question. conPerP1.value should be form.conPerP1.value .

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hi all ! I have been assigned a task to implement an insert query into table a only if a record doesn't exist in table c. I have been scratching my head for past 2 days and even my best friend google didn't help me much, so I am asking the question here.
So, here it is.
I have created dummy tables to simplify the table structure.

CREATE TABLE `test2`.`a` (
`counter` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`name` VARCHAR( 20 ) NOT NULL ,
`age` INT NOT NULL ,
`postcode` VARCHAR( 20 ) NOT NULL ,
`city` VARCHAR( 20 ) NOT NULL
) ENGINE = InnoDB; 




 CREATE TABLE `test2`.`b` (
`counter` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`name` VARCHAR( 20 ) NOT NULL ,
`age` INT NOT NULL ,
`postcode` VARCHAR( 20 ) NOT NULL ,
`city` VARCHAR( 20 ) NOT NULL ,
`country` VARCHAR( 20 ) NOT NULL
) ENGINE = InnoDB;

INSERT INTO `test2`.`b` (`counter` ,`name` ,`age` ,`postcode` ,`city` ,`country`)
VALUES (NULL , 'testuser1', '25', '123456', 'Some city', 'Some country'), 
(NULL , 'testuser2', '26', '234567', 'Some city', 'Some country');



 CREATE TABLE `test2`.`c` (
`counter` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`id` INT NOT NULL ,
`location` VARCHAR( 20 ) NOT NULL
) ENGINE = InnoDB; 

INSERT INTO `test2`.`c` (`counter` ,`id` ,`location`)
VALUES (NULL , '1', 'location1'),
(NULL , '2', 'location2');


 CREATE TABLE `test2`.`d` (
`counter` INT NOT NULL AUTO_INCREMENT PRIMARY KEY ,
`c_id` INT NOT NULL , …
nav33n 472 Purple hazed! Team Colleague Featured Poster

I started with editplus, then notepad++.. Zend studio is the best AFAIK.. I have also used phpeclipse, netbeans and aptana. Even though they are good, I don't like them. They HOG a lot of system resources! Nowadays, I use devphp (not extremely good, but its not that bad. It still lack many features though) !
All of them are open source (yes, free!) except zend studio.

nav33n 472 Purple hazed! Team Colleague Featured Poster

But is that true , when we cut a mango from a tree , well take the mango .

Noooo! mango is just like an egg. Just like how you can incubate an egg to turn it into a cute kiddo chicken, a mango can grow into a huge tree if you nurture it well ! :) So, you cannot eat any fruit. :(
I guess, ice is the only thing that you can eat without hurting any living being!
Btw, I am a vegetarian too.

nav33n 472 Purple hazed! Team Colleague Featured Poster

I am an oracle certified associate (OCA). But the certification didn't help me one bit when I was looking for a job! Even though I had the certification, most companies asked for experience! Bah!
I am not sure about Java certification though. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

I remember years ago there was a guy downtown carrying a sign that read "The air is moving, it could be alive".

You aren't serious! Are you ? :D

Sulley's Boo commented: hum mote nahin hote -.- +6
nav33n 472 Purple hazed! Team Colleague Featured Poster

Yep! Happened to me too when I tried to upload a jpg screenshot. Browser: FF 3.0.8

nav33n 472 Purple hazed! Team Colleague Featured Poster

I can click the 'page 2' thing, but it just takes me back to page 1. FF bug again?

No. Its the same even in IE7.

nav33n 472 Purple hazed! Team Colleague Featured Poster

How many posts per page do you have set in your CP?

Its Use forum default . Resolution isn't the problem. Checked with 2 computers with resolution 1024 * 768 and 1440 * 990. I think its a vBulletin bug !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Ah! Finally it let me add an attachment. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Ah! I see. One more thing on Dani's todo list :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Um. yes it does. copy and paste it into paint, save as jpeg, upload.

It usually allowed me to upload an attachment and I have done it so many times. Today, when I tried to upload, I got an empty screen as if someone had put an exit(); !

nav33n 472 Purple hazed! Team Colleague Featured Poster

Daniweb didn't allow me to upload a screenshot ! :S Check this link for the screenshot of what I see. http://img14.imageshack.us/my.php?image=page2cau.jpg :-/

nav33n 472 Purple hazed! Team Colleague Featured Poster

http://www.daniweb.com/forums/thread183812.html

This thread has 2 pages. But for some reason, I can't go to page2. It redirects me back to page1 ! When I changed the display mode to Hybrid, I noticed that the post by rahul8590 is the last post (and its on page1) ! I am wondering why does it show 2 pages in Linear mode!

nav33n 472 Purple hazed! Team Colleague Featured Poster

(1) I have been doing php for quite some time and I would like to know how a link such as this one works:
http://www.rooftop.com/forums/index.php?do=login&f=31

My problem is the part that comes after the question mark. I have been using joomla of late and such links are very common in joomla and of course all over the net.

The part which comes after the question mark is the parameters (or should I say values) which are being passed through the url. You can access that value by doing, $_GET['do'] in index.php. This is just a way of passing the values from one page to another using the url. In index.php, depending upon this value, a block of code would be executed . Another method is POST, which is the answer for your second question. Go through the link and you will see for yourself how you can access user's input.

nav33n 472 Purple hazed! Team Colleague Featured Poster

So this looked like a nice site to belong to. Thought I would say hi.
Bernie

Hi Bernie! Welcome to Daniweb :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

You can use @ before mysql statements to supress the warning and error messages. @mysql_connect(...)

nav33n 472 Purple hazed! Team Colleague Featured Poster

<offtopic>

Sorry - I guess I am getting grumpy again.

GrimJack, Whenever you mention the word grumpy, it reminds me of Walter character used by ventriloquist Jeff Dunham ;)
</offtopic>

nav33n 472 Purple hazed! Team Colleague Featured Poster

Just let him think what he wants and live in his own little world. After countless times of explanation, he still doesn't get it.

Lets stop replying. Forever.

Yeah! That is what I am gonna do from now on. I value my precious time :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Cwarn23, If you read all the posts, you will see I have no where insulted him. I am just giving a dose of his own medicine, in a sarcastic way.
As I already said in my previous post, he had no respect whatsoever for the other posters. I don't expect that from a new member (and I am sure most of the people here agree with me).
I also think there is a limit for everything. He (rm_daniweb) has surely crossed it.

nav33n 472 Purple hazed! Team Colleague Featured Poster

Just a note to finnish off. Try viewing in the browser view->source of that code in your previous post and you will probably see what everybody has been talking about.

I don't think that is of any use. He is not going to listen/see. He only wants to hear what he wants to hear. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

you are arrogant!!! you are not friendly!! in dealing stupidity of the thread if thereis. I think you are the one stupid!!

Ah! I see. You edited your post just to describe yourself more better! Nice. Every post of yours is helping us to find out more about you (nothing good though! Sigh!).

thank you guys! for accepting the stupidity this thread possessed?!
bye....
another dumbass!

Thank you for accepting who you are.
Bye,
Naveen. :D

nav33n 472 Purple hazed! Team Colleague Featured Poster

if($conn_server = true) {

This is a comparison operator and you are comparing if the value of $conn_server is "true". So, you should use == instead of =.
Apart from that, I don't see anything wrong with your code which could cause an error.

nav33n 472 Purple hazed! Team Colleague Featured Poster

REMEMBER! i am not the one who started to use nasty words!
But if I am triggered I will play hard ball.

First you told me that you are wasting your time the other guy told me that I am ignorant. In the real sense if you are really brainy you will not even throw a glance at my proposition or discovery. But since you answered back that means I have moved you and I can considered my self deep.

The only reason I refrained myself from replying to this thread was because of the amount of stupidity this thread 'possessed'. But, I guess its the right time to knock some sense into you.
rm_daniweb, You need to learn to respect others opinions and answers when it comes from talented and experienced people. You haven't discovered anything supernatural to be proud of. Your discovery is nothing but a 'Hello world' program for most of us here. You don't even have a clue what others are talking about. Nobody hurled abuses at you. You started it with the most common terms which,in fact, could be used to describe you .
You asked everyone if they tested your code. Did you, atleast for once, checked what others are trying to tell you ? I guess not.
This is a public forum and the sole existence of this forum is to help people, which definitely doesn't seem to be on your agenda. Watch your words …

nav33n 472 Purple hazed! Team Colleague Featured Poster

How do I ensure that the submit will go only toward the person who is logged-in's id in the database?

Pass logged person's id as a hidden form element. Use that id to update the table. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

He is a linux user

he clearly said "I had installed RHEL5 Server"

:$ Ah! I clearly missed it.

nav33n 472 Purple hazed! Team Colleague Featured Poster

And if you are a windows user, check this link, especially the reply from a user called 'savbill'. :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

Where are you selecting the id ? I can't understand your code. You need to post your complete code using code tags and explain your problem in detail.

nav33n 472 Purple hazed! Team Colleague Featured Poster

<form> tag should be above <select> tag. <select> tag can't have value attribute. And always use

echo "<option value='".$nt['test_id']."'>".$nt['test_name']."</option>";

instead of

echo "<option value=$nt[test_id]>$nt[test_name]</option>";

(Thats the clean way of writing it).
P.S. Don't use @ before your queries. It will supress the errors and you wont be able to find out what's wrong!

nav33n 472 Purple hazed! Team Colleague Featured Poster

630

nav33n 472 Purple hazed! Team Colleague Featured Poster

Daniel Powter - Bad day ,
but having a good day so far! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

I don't understand... You're using Xampp together with MYSQL?

Huh! Are you talking to yourself ?

I am using Wamp server, I reinstalled Wamp after uninstalling it to try Xaamp.I have completely removed all of the Xaamp files.Recently,I opened my phpmyadmin directory and discovered an error message which hinted to me that there were two MY SQL servers installed on my computer(please refer to http://i89.servimg.com/u/f89/13/69/31/58/sql_mi10.jpg ). I was using an older version of the MY SQL server before I uninstalled it. I am now using a later version. What could be the cause of this error?

Where has verruckt24 mentioned about Xampp ? :S

nav33n 472 Purple hazed! Team Colleague Featured Poster

When I try to view this it gives Apache and PHP up but it is not showing list of users as expected neither giving any error message.
When I try to connect to mysql using loging root and password root it get connected but through PHP it is not working.

If it is not getting connected through php, it will throw an error. Check your php.ini file about error reporting.
If its value is not

error_reporting = E_ALL & ~E_NOTICE

change it. This means, Show all errors except notices.
I tested the script and its fine. But its outdated. Nobody uses session_register nowadays. If you want to register a session variable, you just use $_SESSION = "value";
Quoting from Php.net

Warning
This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged.

Good luck!

nav33n 472 Purple hazed! Team Colleague Featured Poster

Hi everyone,

I am creating a student timetable. I have the table done in html and I now need to input the values in the database.

I was trying to use something along the lines of

if(day = 'Monday' && time = '9') {
echo(subject);
}

i keep getting an error of undefined day and time. I also tried

if(sem1week1.day = 'Monday' && sem1week1.time = '9') {
echo(subject);
}

I got the same error except it was undefined sem1week1.day

appreciate any help

Please post your code and explain your problem in detail. Use [code] tags to wrap your code.

nav33n 472 Purple hazed! Team Colleague Featured Poster

You are welcome! :)

nav33n 472 Purple hazed! Team Colleague Featured Poster

escape single quotes and forward slashes by using mysql_real_escape_string. This will prevent sql injections as well.
Ie.,

$leavetype = mysql_real_escape_string($leavetype);
$fullday = mysql_real_escape_string($fullday);
// and so on...
nav33n 472 Purple hazed! Team Colleague Featured Poster

Well to help answer the questions of why the action= will go to test.php?action=test only when method=post is that when method=get, the parameters in the form overwrite the parameters specified in the action=. However, when using method=post, there are no parameters that can possibly overwrite the action= since it is posting them. So basically it is a browser problem and not a server problem.

Hmm! That answer looks convincing. I guess you are right.

nav33n 472 Purple hazed! Team Colleague Featured Poster

No i am talking about Get method in this case..... when use POST method then it cant

Umm! Let me clear the misunderstanding. This works. The form method is POST and action = test.php?action=test.

<?php
echo $_GET['action'];
?>
<html>
<body>
<form action="test.php?action=test" method="post">
<input type="submit" value="Test"/>
</form>
</body>
</html>

But this doesn't work. The form method is get and action is test.php?action=test.

<?php
echo $_GET['action'];
?>
<html>
<body>
<form action="test.php?action=test" method="get">
<input type="submit" value="Test"/>
</form>
</body>
</html>

My question is, why doesn't GET method go to the action test.php?action=test ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

this will give you the value of objects exist in your form not the value of action "test.php?action=test"

But when you use post method, how could it get the action value from form action along with other form elements ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

The reason is that you cannot pass url variables through the action= but I am not sure if it is the same with the post method though.

It works fine with post method.

<?php
echo $_GET['action'];
?>
<html>
<body>
<form action="test.php?action=test" method="post">
<input type="submit" value="Test"/>
</form>
</body>
</html>

Is there any technical explanation for this ?

nav33n 472 Purple hazed! Team Colleague Featured Poster

$result = mysql_query ("SELECT * FROM $tblname,$connection");

is wrong. Use

$result = mysql_query ("SELECT * FROM $tblname");

:) And please use tags next time to wrap your code.[code=php ] tags next time to wrap your code.

nav33n 472 Purple hazed! Team Colleague Featured Poster

thanks for help. my file has all executable permissions like 755 and i have linux server but how i can apply corn job on my file. just tell me this in easiest way

Did you check the link Look here to see how to setup your own crontab ? You can add a line (or cronjob) in crontab file. This crontab file executes the cronjob at the specified time.

nav33n 472 Purple hazed! Team Colleague Featured Poster

now i am using tinymce only.but when the user user different font it is not working properly.see my output in my attachment.i have save in a image

:-/ I don't see any attachment !

nav33n 472 Purple hazed! Team Colleague Featured Poster

If you have a linux server, then maybe this could help.
http://www.modwest.com/help/kb5-125.html

nav33n 472 Purple hazed! Team Colleague Featured Poster

Or tinymce editor !