";
echo "

";
echo "

";
}
}

// free result set memory
mysqli_free_result($ result);

// close connection
mysqli_close($ connection);

?>


[/code]

The output looks like this:

0) { while($ row = mysql_fetch_row($ result)) { echo “”.$ row[0].”"; echo “”.$ row[1].”"; echo “”.$ row[2].”"; } } // free result set memory mysqli_free_result($ result); // close connection mysqli_close($ connection); ?>

That is all that shows up on the page when opened in a browser. Cutting off at the > in the if statement, which made me assume it is closing my PHP statement. What am I doing wrong here?
By index I am assuming you mean the table data.

It is done in PHPMyAdmin. This is the SQL code used to create the DB and table.

CREATE DATABASE testdb;

CREATE TABLE `symbols` (
`id` int(11) NOT NULL auto_increment,
`country` varchar(255) NOT NULL default ”,
`animal` varchar(255) NOT NULL default ”,
PRIMARY KEY (`id`)
) TYPE=MyISAM;

INSERT INTO `symbols` VALUES (1, ‘America’, ‘eagle’);
INSERT INTO `symbols` VALUES (2, ‘China’, ‘dragon’);
INSERT INTO `symbols` VALUES (3, ‘England’, ‘lion’);
INSERT INTO `symbols` VALUES (4, ‘India’, ‘tiger’);
INSERT INTO `symbols` VALUES (5, ‘Australia’, ‘kangaroo’);
INSERT INTO `symbols` VALUES (6, ‘Norway’, ‘elk’);

a table with 3 columns and 6 data entries.
I did try what you said, and changed it to:

” if (0 < mysql_num_rows($ result)) "

and got a slightly different, but equally confusing result:

".$ row[0].""; echo "".$ row[1].""; echo "".$ row[2].""; } } // free result set memory mysqli_free_result($ result); // close connection mysqli_close($ connection); ?>

Best answer:

Answer by voshii
Hi, noBull

please put the main index as well to investigate the issue
it is just an output
also yourweb-serverr may not beconfiguredd well

thank you

Know better? Leave your own answer in the comments!

HISONICS WHM-306 WIRELESS HANDHELD MICROPHONE SYSTEM COMPLETE & W/ CASE NR

ONE Animal Texture Whistle Toy,Bell,Kids,Favours,WHM005

SCRABBLE TILE PENDANT Elegant Royal Crown WHM023

ONE Animal Texture Whistle Toy,Bell,Kids,Favours,WHM005
US $1.18
End Date: Monday May-21-2012 7:36:38 PDT
Buy It Now for only: US $1.18
Buy it now | Add to watch list

6 x Animal Texture Whistle Toy,Bell,Kids,Favours,WHM005
US $4.93
End Date: Monday May-21-2012 7:40:52 PDT
Buy It Now for only: US $4.93
Buy it now | Add to watch list

ONE Animal Texture Whistle Toy,Bell,Kids,Favours,WHM005
US $1.20
End Date: Monday May-21-2012 7:46:30 PDT
Buy It Now for only: US $1.20
Buy it now | Add to watch list

How to fix php error Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given ?

Question by : How to fix php error Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given ?
I’m following a tutorial on php private messaging system.
On pm.inbox.php , I’m facing these errors.

Warning: mysql_num_rows() expects parameter 1 to be resource,
boolean given in C:\wamp\www\post\includes\pm_inbox.php on line 48

Warning: mysql_fetch_array() expects parameter 1 to be resource,
string given in C:\wamp\www\post\includes\pm_inbox.php on line 59

pm_inbox.php code is here.

session_start();

require_once 'connect_i.php';
/*$ email = $ _POST['email'];*/
$ myConnection = mysqli_connect("$ db_host",
"$ db_username","$ db_pass","$ db_name")
or die("Could Not Connect to MySQL");
$ sqlCommand = " SELECT id, email FROM users
WHERE email='" . $ _SESSION['email'] . "' ";
$ query = mysqli_query($ myConnection,
$ sqlCommand) or die (mysqli_error());
while ($ row = mysqli_fetch_array($ query)){
$ pid = $ row["id"];
$ email = $ row["email"];
}
mysqli_free_result($ query);

$ sqlCommand =
" SELECT COUNT(id) AS numbers FROM pm_inbox
WHERE userid = '$ pid' ";
$ query = mysqli_query($ myConnection, $ sqlCommand) or die (mysql_error());
$ result = mysqli_fetch_assoc($ query);

$ inboxMessages = $ result['numbers'];

?>



PHP Private message tutorial

Welcome back
Welcome back

require_once "connect.php";

$ sql = " SELECT * FROM pm_inbox WHERE userid =
'$ pid' ORDERED by DESC ";
$ result = mysql_query($ sql);

$ count = mysql_num_rows($ result);

?>

while($ rows = mysql_fetch_array('$ result')){
?>


# Title: From:
“>
value="“> “>
0) { ?>

value="Delete Selected Messages"> else { print "There are no messages in your inbox"; }
?>

Please Login


Can Some one tell me what is the actual reason ?
I try to find in google but it tells that mysql query is failed.
If it is, then how to make a query working?

Best answer:

Answer by Ratchetr
This call:
$ result = mysql_query($ sql);

is failing, and returning false. When you pass false (which is what will be in $ result to mysql_num_rows or mysql_fetch_array, you will get the error message you are seeing.

The reason it is failing is that this query is wrong:
SELECT * FROM pm_inbox WHERE userid =
‘$ pid’ ORDERED by DESC

ORDERED by isn’t what you want.

You want:
ORDER by

Give your answer to this question below!

WebHosting Reseller?

Question by M: WebHosting Reseller?
I have two questions about webhosting reseller;s pro gramme
1- As a webhosting reseller, why the disk space is important for me?
2-What is the best webhosting company that offer competitive and affordable prices with WHM/cPanel control panel?
please advice

Best answer:

Answer by desertcities
There are many web hosting reseller accounts out there. You need to shop around and see what each offers. Many resellers today are reselling other reseller services. If that makes sense. All using the same larger company’s hardware and bandwidth infastructure, but each having a little different look.

To answer your questions:

1. Disk space becomes important only if the reseller package you select gives you little hard drive space. Most give you enough space to accommodate the majority of your web hosting customers and more.

2. You really need to search and visit each site and see what you get for your money. You might find it advantageous to get your own dedicated server or a VPS server. Just make sure you get enough RAM on your machine and that it comes pre-installed with lots of software, if possible.

I use 1and1.com VPS plus Lypha.com and HostGater.com reseller services. I can share with you the things that are important to me and what to look for.

1. Make sure the web hosting reseller company is solid and that they have a good customer support program. If they don’t offer even a telephone number to call for help, find another.

2. Ask how many domains you can host and what they charge for dedicated IP addresses. Some can go up to $ 5.00 per dedicated IP per domain a month! You need a dedicated IP for any customer of yours who runs a SSL Certificate.

3. Ask how many concurrent TCP/IP connections you can have at any given time. I was in shock when one of my clients told me I could only have 10 simultaneous connections to their server, my server, at any given time. My own IP was being blacklisted to my own rented server when I went past 10 connections. How absurd is that?

4. Try to find a reseller that includes a nice billing system for you to use and to bill your clients.

5. Ask if their web servers are also the SQL and email servers too. If they are and if they oversell reseller packages using the same servers, your customers could be stuck with slowdowns and even crashes that close their sites. You might want to check to see how many other domains are on the same server you’re using and check to see if your server is overloaded and slow.

Most resellers include Plesk or Cpanel that includes lots of pre-loaded software for your customers to use. Hopefully they offer a demo test-drive so you can check things out.

Good Luck!

Know better? Leave your own answer in the comments!

PHP > seems to be closing my PHP tag?

Question by noBull: PHP > seems to be closing my PHP tag?
[code]





// set server access variables
$ host = "localhost";
$ user = "HANJER59";
$ pass = "k2032K";
$ db = "testdb";

// open connection
$ connection = mysqli_connect($ host, $ user, $ pass, $ db) or die ("Unable to connect!");

// create query
$ query = "SELECT * FROM symbols";

// execute query
$ result = mysqli_query($ connection, $ query) or die ("Error in query: $ query. ".mysqli_error());

if (mysql_num_rows($ result) > 0) {
while($ row = mysql_fetch_row($ result)) {
echo "

".$ row[0]." ".$ row[1]." ".$ row[2]."
US $1.18
End Date: Monday May-21-2012 7:36:38 PDT
Buy It Now for only: US $1.18
Buy it now | Add to watch list

6 x Animal Texture Whistle Toy,Bell,Kids,Favours,WHM005
US $4.93
End Date: Monday May-21-2012 7:40:52 PDT
Buy It Now for only: US $4.93
Buy it now | Add to watch list

ONE Animal Texture Whistle Toy,Bell,Kids,Favours,WHM005
US $1.20
End Date: Monday May-21-2012 7:46:30 PDT
Buy It Now for only: US $1.20
Buy it now | Add to watch list
May 6th, 2012 | Tags: , , , , , , , | Category: Host Manager | Leave a comment

How to make MyBB forum using FileZilla and Free Hosting (byethost.com)

In this video i show u how to install MyBB Forum on free hosting (byethost.com) using FileZilla.
Video Rating: 5 / 5

May 6th, 2012 | Tags: , , , , , , | Category: Hosting | 24 comments

AC Adapter Supply Cord for IBM 02K6673 92P1025 WHM

ONE Animal Texture Whistle Toy,Bell,Kids,Favours,WHM005
US $1.18
End Date: Monday May-21-2012 7:36:38 PDT
Buy It Now for only: US $1.18
Buy it now | Add to watch list

6 x Animal Texture Whistle Toy,Bell,Kids,Favours,WHM005
US $4.93
End Date: Monday May-21-2012 7:40:52 PDT
Buy It Now for only: US $4.93
Buy it now | Add to watch list

ONE Animal Texture Whistle Toy,Bell,Kids,Favours,WHM005
US $1.20
End Date: Monday May-21-2012 7:46:30 PDT
Buy It Now for only: US $1.20
Buy it now | Add to watch list
May 6th, 2012 | Tags: , , , , | Category: Host Manager | Leave a comment

PhP – MySQL email validation issue?

Question by 24JJ24: PhP – MySQL email validation issue?
Hi,

I am trying to get some code straight. I know this is a complete and utter mess, my apologies (newbie coder). The aim of the script is that if the email matches a regex expression (previously defined), then it checks the database to see if the email the user has entered is already there. If it is, it prints back a message telling the user to enter a new one.

The database field itself is unique, so technically there will be no other email that is the same, however for the sake of having to redirect the user back I’d like to just keep all the validation on one page.

However, when I enter an email that already exists in the database, it still lets me continue to the database page. Not sure why this is, can anyone help me out?

Thanks

//Email Validation
$ email = clean($ _POST['Email1']);
$ pattern = '/^([a-zA-Z0-9])+([a-zA-Z0-9\._-])*@([a-…
if ($ emailpattern=(preg_match($ pattern, $ _POST['Email1'])) > 0){
$ emailclass = “basictext”;
$ flag1=”OK”;
}
else{
$ emailclass = “errortext”;
$ flag1=”NOTOK”;
$ emailvalidationcheck =”NOTOK”;
}
?>

$ flag = "NOTOK";
print '
Please enter a valid Email Address.

‘;
}
else if ($ emailvalidationcheck == “OK”){

$ host=”***********”; // Host name
$ username=”*********”; // Mysql username
$ password= (DATABASE_PASSWORD); // Mysql password
$ db_name=”********”; // Database name
$ tbl_name=”customers”; // 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 = mysql_query( “SELECT `customers_email_address` FROM `”.$ tbl_name.”` WHERE `customers_email_address` = \’” . mysql_real_escape_string( $ email ) . “\’ LIMIT 1″ );
$ result = mysql_fetch_row($ sql);
mysql_free_result($ result);
if(isset($ result[customers_email_address])){
$ emailclass = “errortext”;
$ flag=”NOTOK”;
print ‘
This email address is already in use.

‘;
}
else if(!isset($ result[customers_email_address])){
$ emailclass = “basictext”;
$ flag=”OK”;
}
}

?>
Thanks, will give this a go :)

Would rather just keep it all validated in PhP incase someone has Javascript turned off.

Thanks again
Still not working :/ no idea what’s going on with this script, will try and re-write it differently perhaps.

Best answer:

Answer by Erato
Why bother with the regex… Just do this
$ sql=”SELECT * FROM table_name WHERE customers_email_address=’”.$ _Post['Email1'].”‘ ”
if($ sql==null){
//No Email Exists
}
else{
//Email Exists
}

I would do the Regex validation in Javascript then only submit the form field when the script returns true otherwise clear the field and make it red or something. You could also use something like this for the validator.

http://labs.adobe.com/technologies/spry/samples/validationwidgets/TextfieldValidationSample.html

http://labs.adobe.com/technologies/spry/demos/formsvalidation/index.html

Heres the homepage to dl and get the documentation

http://labs.adobe.com/technologies/spry/home.html

You probably also want to escape that Post variable to prevent SQL injection

Add your own answer in the comments!

Tutorial – WHM si cPanel

Acesta este un tutorial facut pentru gamingtv.ro la WHM, pentru mai multe tutoriale si video-uri din lumea gaming-ului vizitati site-ul nostru!

How You Start Your Own Business With Reseller Hosting Account (WHM).

How You Start Your Own Business With Reseller Hosting Account? Resource Link : ezinearticles.com
Video Rating: 3 / 5

Categories

Meta

Tags

Copyright © 2012 MyHostPal - All Rights Reserved A RuzzMan LLC Venture
Powered by WordPress & Atahualpa

Powered by Yahoo! Answers