project

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
vijeshkrishna
Forum Newbie
Posts: 3
Joined: Thu Sep 29, 2011 9:30 pm

project

Post by vijeshkrishna »

i am doing a project where a user has to send and receive mails .i am new to php .can i do this using php and have my own domain name like gmail .or should i choose other language ? please help
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: project

Post by pickle »

I've split this post into it's own project. Please don't try to hijack threads.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
vijeshkrishna
Forum Newbie
Posts: 3
Joined: Thu Sep 29, 2011 9:30 pm

Post by vijeshkrishna »

thanks!!!!!!!!!!!!!!
vijeshkrishna
Forum Newbie
Posts: 3
Joined: Thu Sep 29, 2011 9:30 pm

Re: project

Post by vijeshkrishna »

i am developing a project using php and mysql.i need to store the return value in a variable after running the select statement.

Code: Select all

$q = "SELECT name FROM users WHERE u_no='$no'";

						 
						 $r =@mysqli_query ($dbc ,$q); 
						 
						 $num = mysql_num_rows($r);                                  
						 
						 if ($num > 0)
						 {
						 		
								$row=mysql_fetch_array($r);
								


i need to store the returned name value to a variable.please help me out .i am stuck.....
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: project

Post by pickle »

If you have a new question, create a new topic. This will help you get help quicker as the title will be more relevant. It will also help future members when searching with a similar problem.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
User avatar
Celauran
Moderator
Posts: 6427
Joined: Tue Nov 09, 2010 2:39 pm
Location: Montreal, Canada

Re: project

Post by Celauran »

vijeshkrishna wrote:i need to store the returned name value to a variable.please help me out .i am stuck.....
Are you expecting only a single result? If so, I'd add LIMIT 1 to your query.

Code: Select all

<?php

$query  = "SELECT name FROM users WHERE u_no = '$no' LIMIT 1";
$result = mysqli_query($query);

if ($result !== FALSE)
{
    list($name) = mysqli_fetch_row($result);
}

?>
Post Reply