$SQLSELECT = "SELECT * FROM nov ";
				$result_set =  mysqli_query($SQLSELECT, $conn);
				while($row = mysqli_fetch_array($result_set))
						<td><?php echo $row['name']; ?></td>
						<td><?php echo $row['cpu_count']; ?></td>
						<td><?php echo $row['memory_size']; ?></td>
						<td><?php echo $row['disk_space_size']; ?></td>
						<td><?php echo $row['nic_count']; ?></td>
						<td><?php echo $row['power_state']; ?></td>

Open in new window

ERROR : Warning: mysqli_query() expects parameter 1 to be mysqli, string given in C:\xampp\htdocs\display\index.php on line 78

Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, null given in C:\xampp\htdocs\display\index.php on line 79
Yong Scott Asked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Switch the order of $conn and your query so $conn is first:
$result_set =  mysqli_query($conn, $SQLSELECT);

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Dave BaldwinFixer of ProblemsCommented:
As shown in the Procedural style example on this page , you have to make the connection first with mysqli_connect() .  I don't see that in your example.  You have to do that on each PHP page that you load.  If you did it on a previous page, it does not count for the current page.
Yong Scott Author Commented:
That 1 success already but its appear on other coding
Notice: Undefined offset: 6 in C:\xampp\htdocs\display\import.php on line 18

Fatal error: Uncaught Error: Call to undefined function mysql_query() in C:\xampp\htdocs\display\import.php:20 Stack trace: #0 {main} thrown in C:\xampp\htdocs\display\import.php on line 20

include 'db.php';

		echo $filename=$_FILES["file"]["tmp_name"];

		 if($_FILES["file"]["size"] > 0)

		  	$file = fopen($filename, "r");
	         while (($emapData = fgetcsv($file, 10000, ",")) !== FALSE)
	          //It wiil insert a row to our subject table from our csv file`
	           $sql = "INSERT into subject (`(`name`, `cpu_count`, `memory_size`, `disk_space_size`,`nic_count`, `power_state`) 
	         //we are using mysql_query function. it returns a resource on true else False on error
	          $result = mysql_query( $sql, $conn );
				if(! $result )
					echo "<script type=\"text/javascript\">
							alert(\"Invalid File:Please Upload CSV File.\");
							window.location = \"index.php\"

Open in new window

Rowby Goren Makes an Impact on Screen and Online

Learn about longtime user Rowby Goren and his great contributions to the site. We explore his method for posing questions that are likely to yield a solution, and take a look at how his career transformed from a Hollywood writer to a website entrepreneur.

That is a different error. Please open a separate question for the new error and mark this one as solved to avoid confusion.
Yong Scott Author Commented:
okay .. i will post new question
Actually, I'm done for the evening, so here are my comments for your next 2 questions ahead of time (since your new question isn't posted just yet):

Okay, so first the undefined offset problem is simply the result of you starting your array indexes at 1. In PHP, arrays start at zero, so the first element in your array is $emapData[0], not $emapData[1]. So the error is saying that there is no index "6", which means  $emapData[6] doesn't exist. To solve this, just shift all your index numbers down by one so your last element is $emapData[5], not $emapData[6].

The second problem:
Call to undefined function mysql_query() due to the deprecation of the mysql_ functions. You should be using mysqli_ functions instead, like you did in the first script you had.
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.