[Delta NITT] View this page: "Tasks in general coding and PHP/MySql"

13 views
Skip to first unread message

Kulz

unread,
May 20, 2010, 2:06:20 AM5/20/10
to Delta NITT


Click on http://groups.google.co.in/group/delta-nitt/web/tasks-in-general-coding-and-php-mysql
- or copy & paste it into your browser's address bar if that doesn't
work.

Mohnish prasanna

unread,
May 21, 2010, 8:22:17 AM5/21/10
to Delta NITT
should it be like an MIS???????????

On May 20, 11:06 am, Kulz <shankarram...@gmail.com> wrote:
> Click onhttp://groups.google.co.in/group/delta-nitt/web/tasks-in-general-codi...

Shankarram A

unread,
May 21, 2010, 8:30:31 AM5/21/10
to delta...@googlegroups.com
Left to you. We just want to see your involvement in creating a database driven webpage. For my inductions i made a text based mafia game in php so its upto you as long as provide functionality.

Mohnish.........NIT(T)-ECE

unread,
May 21, 2010, 8:34:52 AM5/21/10
to delta-nitt
i have started to learn php from yesterday only.....how long will it take for me to do this task???....

Shankarram A

unread,
May 21, 2010, 8:42:46 AM5/21/10
to delta...@googlegroups.com
Dont worry, just learn it well. And check out http://w3schools.com/ . I like the way they build up the topics.
"It doesnt take much time to learn a new language, it takes a lifetime to master it" - myself ;)
 
As we said. Learn the basics. Must take about 2 or 3 days to go through the basics and syntax. Then start off coding and use google whenever you get stuck. You can also post here or message any of us if you get stuck somewhere and cant find the solution after looking for a long time.
 
Main thing is once you get the hang of it, then it wont take time to code things. Its the first few programs to get used to the language that are the hardest. Also copy paste wont help! You have to code to learn!! remember we will be asking you questions based on your work at the interview and we arent known to be very kind there if we find you arent confident with your own code! So be sure of what your doing and you should be fine.

Mohnish.........NIT(T)-ECE

unread,
May 21, 2010, 9:03:11 AM5/21/10
to delta-nitt
from where to learn the bacics on how to work with uniform server?????

Abhishek

unread,
May 21, 2010, 10:21:39 AM5/21/10
to Delta NITT
Page updated ! Find information about using Uniserver on the page.

Abhishek Shrivastava

unread,
May 21, 2010, 10:22:17 AM5/21/10
to delta...@googlegroups.com
I've updated the page about the Task 1 with the basic information about using Uniserver. Check that out.

Mohnish.........NIT(T)-ECE

unread,
May 21, 2010, 1:07:21 PM5/21/10
to delta-nitt
thanks

Abhishek

unread,
May 23, 2010, 4:37:33 PM5/23/10
to Delta NITT
First Years: You can post any problems or questions regarding Task 1 :
PHP/MySQL, here.

paarth dandiwala

unread,
May 25, 2010, 4:50:11 PM5/25/10
to Delta NITT
hi...
m having problem with connecting sql with php.......i have got
uniserver...as guided by u.......n php..is workin...fine......

m gettin an error.....not able to connect to the sql.....so kindly
help me out....
(plz tell me what exacly do i need to writ the code...)

Shankarram A

unread,
May 26, 2010, 12:18:39 AM5/26/10
to delta...@googlegroups.com
Well the default username and password for uniserver is root and root, and the host is localhost. Most often this causes the error.
$username = "root";
$pass = "root";
 
$link mysql_connect('localhost'$username$pass);
if (!
$link
) {
    die(
'Could not connect: ' mysql_error
());
}
echo 
'Connected successfully'
;
mysql_close($link
);

paarth dandiwala

unread,
May 26, 2010, 2:25:49 AM5/26/10
to delta...@googlegroups.com
i tried what u told....but m still having the same prob.......what can..be the reason else than this...???

Shankarram A

unread,
May 26, 2010, 2:36:12 AM5/26/10
to delta...@googlegroups.com
Check if mysql is running first. Sometimes it might not be started at all. try restarting uniserver too.
Im pretty sure that code should run after all its from php.net!

AXE-N

unread,
May 26, 2010, 6:26:50 AM5/26/10
to Delta NITT
Doubt in PHP

If I am using notepad,where should I save it?And what is the url I am
supposed to input?


Chakradar Raju

unread,
May 26, 2010, 6:38:04 AM5/26/10
to delta...@googlegroups.com
you have to save it in your www folder in your server directory.
and you give http://localhost/[path from www]
eg: if the php file is saved in www\project1\index.php, the url will be "http://localhost/project1/index.php"

Shankarram A

unread,
May 26, 2010, 6:38:58 AM5/26/10
to delta...@googlegroups.com
I hope you have installed uniserver first. You need apache or similar running to execute php. Once thats done you need to paste the files inside a folder called www. Access it through your browser using localhost ... As far as i recollect when you open uniserver you get a z:/ and the localhost page.
 
 
On a different note:
If you think there is some problem with your uniserver [have seen it happen at times] try http://www.cwahi.net/ ... register and u get a free account. Wait till ur subdomain is all setup. Upload the phpfiles and check there. You get a database as well. There are several others but i have used this and its all automated and works. Just give it some time after registration for setup.
 

 
On Wed, May 26, 2010 at 3:56 PM, AXE-N <akshaynath...@gmail.com> wrote:

Uday Deogam

unread,
May 26, 2010, 4:23:24 PM5/26/10
to Delta NITT
Hi
I am having problem with connecting sql with php.......
I have got uniserver.....
but i dont think it is configured to come into use..
i was able to create the server(I dont know but i was able to see the
drive)...
but still was unable to connect sql with php
Please tell me how to configure it so that i can use it..

Mohnish prasanna

unread,
May 26, 2010, 7:04:18 PM5/26/10
to Delta NITT
Welcome to phpMyAdmin


Error

MySQL said:

#1045 - Access denied for user 'root'@'localhost' (using password:
YES)
phpMyAdmin tried to connect to the MySQL server, and the server
rejected the connection. You should check the host, username and
password in your configuration and make sure that they correspond to
the information given by the administrator of the MySQL server.


I AM GETTING THE ABOVE ERROR WHEN I TRY TO GO INTO MY
PHPMYADMIN......I TRIED DOWNLOADING MANY VERSIONS OF UNISERVER BUT THE
PROBLEM PERSISTS......HELP ME RESOLVE IT.........


On May 26, 3:38 pm, Shankarram A <shankarram...@gmail.com> wrote:
> I hope you have installed uniserver first. You need apache or similar
> running to execute php. Once thats done you need to paste the files inside a
> folder called www. Access it through your browser using localhost ... As far
> as i recollect when you open uniserver you get a z:/ and the localhost page.
>
> On a different note:
> If you think there is some problem with your uniserver [have seen it happen

> at times] tryhttp://www.cwahi.net/... register and u get a free account.


> Wait till ur subdomain is all setup. Upload the phpfiles and check there.
> You get a database as well. There are several others but i have used this
> and its all automated and works. Just give it some time after registration
> for setup.
>

Shankarram A

unread,
May 27, 2010, 12:25:47 AM5/27/10
to delta...@googlegroups.com
Do this go to localhost/apanel from your browser. You must see uniservers control panel. You should see an option there to change mysql root password. Change and try opening from phpmyadmin provided there. Im recollecting from memory as it has been a while since i used uniserver ... Your issue though, seems to be the password is incorrect so reset and try again

Aparna

unread,
May 27, 2010, 5:37:17 AM5/27/10
to Delta NITT
I'm using wampserver and its pretty straightforward in that it does
not create a new drive or anything. Plus it was easy to install, and I
connected to the database in one go. So I guess you could use that;
its basically all about implementing the code. The default username is
'root' and password is ' '.

Balanivash

unread,
May 27, 2010, 5:45:08 AM5/27/10
to Delta NITT
@Mohanish: One thing you could do is as shankarram suggested.....The
other thing you can do is go to the uniserver folder, in it there will
be a folder named apps and in it a folder named phpmyadmin. go to
that....within it find a file named "config.inc.php" ...you've to edit
this.....Open the file and you'll find a line

$cfg['Servers'][$i]['password'] = ' ';// MySQL password (only
needed with 'config' auth_type)


Enter your mysql password in the quotes and save the file.....


paarth dandiwala

unread,
May 28, 2010, 4:46:10 AM5/28/10
to delta...@googlegroups.com
i have one more doubt......when m using..mysql_fetch_assoc()...function...m gettin an eroor which says:Warning: mysql_fetch_assoc() expects parameter 1 to be resource, boolean given in C:\wamp\www\plogin.php on line 22
........
 
so...can u help me .....in solvin this prob....plzz....

Shankarram A

unread,
May 28, 2010, 4:50:09 AM5/28/10
to delta...@googlegroups.com
You can use fetch_array and use associative linking. It works and the problem seems to be missing parameter as it says!
 
See if you have given yourArray[elementName] while using it you have probably used yourArray

jack

unread,
May 28, 2010, 5:08:30 AM5/28/10
to Delta NITT
it seems that you've not passed a valid query result as parameter.
check whether you've passed something which mysql_query() function has
returned.

In case the problem persists, you can post the script so that we can
debug it.

On May 28, 1:46 pm, paarth dandiwala <paarth.dandiw...@gmail.com>
wrote:
> i have one more doubt......when m using..mysql_fetch_assoc()...function...m
> gettin an eroor which says:*Warning*: mysql_fetch_assoc() expects parameter
> 1 to be resource, boolean given in *C:\wamp\www\plogin.php* on line *22*

paarth dandiwala

unread,
May 28, 2010, 5:15:52 AM5/28/10
to delta...@googlegroups.com
a part of my script is as follows:
 
 


$connect=mysql_connect('localhost','root','');
 mysql_select_db("login") or die("could not find the database...");
 
 
 $query=mysql_query("select * from logint where username=$username");
 
 while($row=mysql_fetch_assoc($query))
 {
 $dbusername=$row['username'];
 $dbpassword=$row['password'];
 }
 

Chakradar Raju

unread,
May 28, 2010, 5:28:11 AM5/28/10
to delta...@googlegroups.com
its always a good practice to use quotes to enclose values.
so your query should be like "select * from `logint` where `username`='$username'"
note that the (`) is backtick and (') is single quote.
` is used to enclose tablename and column names whereas ' is used to enclose values.

Shankarram A

unread,
May 28, 2010, 5:28:25 AM5/28/10
to delta...@googlegroups.com
have you tried running the query on mysql directly substituting for username? valid?
 
first try if this gives the following
 
if($query)
  echo "Valid Query";


 
On Fri, May 28, 2010 at 2:45 PM, paarth dandiwala <paarth.d...@gmail.com> wrote:

Shankarram A

unread,
May 28, 2010, 5:32:09 AM5/28/10
to delta...@googlegroups.com
If it fails in mysql then make correction in the query. MySql expects the strings to be within ' string ' ... $username may translate to the sql looking for a field with name username which throws and error. You should be getting this as error
 in php try '$username' ... 

paarth dandiwala

unread,
May 28, 2010, 5:46:23 AM5/28/10
to delta...@googlegroups.com
yup.....chakradhar raju......gave me the clue....n now..its running.....but a new error has come up....
 
Notice: Undefined variable: dbusername in C:\wamp\www\plogin.php on line 31
 
and the code is:
 
while($row=mysql_fetch_assoc($query))
 {
 $dbusername=$row['username'];
 $dbpassword=$row['password'];
 }
 
 
 
   if($username==$dbusername&&$password==$dbpassword)
   {
   echo "u got in!!!.......click here";
   //echo"now to enter the ur info page <a href="puser.php">click here</a>";
   }
 
so....can u plzz...help me out.....m trying...but facing probs again and agin.....n find them....really small...when someone like u guide me..out.... 

Shankarram A

unread,
May 28, 2010, 5:50:47 AM5/28/10
to delta...@googlegroups.com
Initialize the variables before the while loop and you really dont need to check username again as its there in the sql query already.
 
One more thing is most small bugs can be fixed using google. Just copy, paste and search if there are solutions. Much faste rthan waiting for one of use to reply

paarth dandiwala

unread,
May 28, 2010, 5:53:27 AM5/28/10
to delta...@googlegroups.com
got ur points...thnx..a lot..
 

Harsh Rai

unread,
May 28, 2010, 12:34:38 PM5/28/10
to delta...@googlegroups.com
hi..i downloaded d uniserver as u tld...but apache,my sql n php servers r not gettin on..initially i had problem only wid  apache..den i downloaded n other one from d wampserver website..but nw all three of them doesn seem to b workin..in the sense it says the ports are nt available and are in use....
 
please guide me n help me sort this problem out...
 
i'm currently readin the php manual n tryin dos codes..

Mohnish prasanna

unread,
May 28, 2010, 12:49:46 PM5/28/10
to Delta NITT, i. abhi27
how should we submit it???? should we compress it or something ???
what format to export the database???

Abhishek

unread,
May 28, 2010, 1:50:37 PM5/28/10
to Delta NITT
Updates regarding the submission of application ..

Click on http://groups.google.co.in/group/delta-nitt/web/tasks-in-general-coding-and-php-mysql
- or copy & paste it into your browser's address bar if that doesn't
work.

Mohnish prasanna

unread,
May 29, 2010, 2:37:53 AM5/29/10
to Delta NITT
<?php
$username = $_POST['username'];

if($username != 'admin')
{
$db = mysql_connect("localhost", "user","user123");
mysql_select_db("user",$db);
$sql="UPDATE logindb SET password = '$username' WHERE
CONVERT( username USING utf8 ) = '$username' LIMIT 1 ;";
$result = mysql_query($sql);

if(!result)
{
header("location:wreset.php");
}
else
{
header("location:creset.php");
}
}
else
{
echo "Contact Server Manager to Retrieve the Password . <a href=
\"index.php\">Click here</a> to go back to Login page";
}
?>


THE ABOVE IS MY CODE FOR RESETTING OF PASS.THE VALUE OF RESULT IS
ALWAYS 1 WHETHER OR NOT USERNAME EXISTS IN DATABASE OR NOT
...WHY IS THAT SO....IS THERE ANY PROBLEM WITH THE CODE?...

Dinesh

unread,
May 29, 2010, 3:15:56 AM5/29/10
to Delta NITT
I need to use a variable declared within php script on a
javascript....
I cannot access javascript functions from php so I cannot even pass
the variable as a parameter...
I need to output the variable value in a textbox of the same page
using javascript...
Please Help!!
And another doubt is that the project to be submitted tomorrow is
counted on concepts or also on rich style sheets???
Because uploading such a file along with css attachments and linked
images will be little hefty...
I mean is it just sufficient if the page styles are simply designed???
Dinesh Prasanth

On May 28, 10:50 pm, Abhishek <i.abh...@gmail.com> wrote:
> Updates regarding the submission of application ..
>
> Click onhttp://groups.google.co.in/group/delta-nitt/web/tasks-in-general-codi...

Shankarram A

unread,
May 29, 2010, 5:01:42 AM5/29/10
to delta...@googlegroups.com
Restart the comp and try to run only one of wamp or uniserver ... See if you get the same error.

Shankarram A

unread,
May 29, 2010, 5:03:48 AM5/29/10
to delta...@googlegroups.com
  if(!result)
       {
               header("location:wreset.php"); ....

result is not a variable ... try
if(!$result)

Chakradar Raju

unread,
May 29, 2010, 7:06:51 AM5/29/10
to delta...@googlegroups.com
remember that PHP generates web pages(server-side-script) and Javascript starts running after the page gets loaded in the browser(client-side-script), both doesn't runs parallel, to simply pass the value. So, you need to write the value somewhere so that javascript can read from there.
This example might help you understand it:
<?php
$variable = "This value is in php";
?>

<script type="text/javascript">
window.onload = function() {
document.write("This is written from Javascript: " + document.getElementById("fromPHP").value);
}
</script>

<input type=hidden id="fromPHP" value="<?=$variable?>">

abhishek will reply for the other query.

Abhishek Shrivastava

unread,
May 29, 2010, 12:36:59 PM5/29/10
to delta...@googlegroups.com
We will only be evaluating the project you did based on your PHP and MySQL programming skills. If you've used Javascript, CSS or AJAX, its a bonus but not required.


And another doubt is that the project to be submitted tomorrow is
counted on concepts or also on rich style sheets???
Because uploading such a file along with css attachments and linked
images will be little hefty...
I mean is it just sufficient if the page styles are simply designed???

--
Abhishek Shrivastava
E.C.E., N.I.T. Trichy

Dinesh

unread,
May 29, 2010, 12:50:42 PM5/29/10
to Delta NITT
Oh thanks.... I was just wondering about the real time use of hidden
tags... The bridge betwn php and javascript is working properly....
Points were helpful... thnks again.....!

On May 29, 4:06 pm, Chakradar Raju <chakradarr...@gmail.com> wrote:
> remember that PHP generates web pages(server-side-script) and Javascript
> starts running after the page gets loaded in the
> browser(client-side-script), both doesn't runs parallel, to simply pass the
> value. So, you need to write the value somewhere so that javascript can read
> from there.
> This example might help you understand it:
> <?php
> $variable = "This value is in php";
> ?>
>
> <script type="text/javascript">
> window.onload = function() {
> document.write("This is written from Javascript: " +
> document.getElementById("fromPHP").value);}
>
> </script>
>
> <input type=hidden id="fromPHP" value="<?=$variable?>">
>
> abhishek will reply for the other query.
>

Dinesh

unread,
May 29, 2010, 12:52:02 PM5/29/10
to Delta NITT
Okay I got it.... Thanks....!

Abhishek

unread,
May 29, 2010, 1:16:45 PM5/29/10
to Delta NITT

Dinesh

unread,
May 30, 2010, 7:37:53 AM5/30/10
to Delta NITT
I finished uploading my files...
I am free till 7th... I am interested about designer stuff also...
So can I work and submit for Designer Tasks also???
I mean can I work for both designing and developing??

On May 29, 10:16 pm, Abhishek <i.abh...@gmail.com> wrote:
> Deadline extended to 7th June !
>
> Click onhttp://groups.google.co.in/group/delta-nitt/web/tasks-in-general-codi...

Balanivash

unread,
May 30, 2010, 8:13:23 AM5/30/10
to Delta NITT
@Dinesh: It is up to you, if you want to work on both the topics you
can ....Also if you want to improve your submission it'll be ok...
Just work on what you think it'll be best for you

Abhishek Shrivastava

unread,
May 30, 2010, 2:46:19 PM5/30/10
to delta...@googlegroups.com
@Dinesh : yes you can work on both. Infact it'd be great if u have good knowledge of both designing and coding because then you have better chances as we would prefer people like that. However, if ur applying as a designer also then ur designs should be really better than those who are dedicated for designs only. Remember, we want quality and not quantity.

Abhishek

unread,
Jun 8, 2010, 4:27:38 AM6/8/10
to Delta NITT
Submissions List Updated ! Every check if your name is there. If not
and you've submitted before deadline, contact us.

Click on http://groups.google.co.in/group/delta-nitt/web/tasks-in-general-coding-and-php-mysql?hl=en-GB

Abhishek

unread,
Jun 8, 2010, 4:28:28 AM6/8/10
to Delta NITT
---Discussion Closed---
Deadline has passed for Task1. You can view the list of successful
submissions in the Task 1 page.

Abhishek

unread,
Jun 9, 2010, 5:50:58 PM6/9/10
to Delta NITT
Reply all
Reply to author
Forward
0 new messages