Hello PHP fanatics, The browser shows Warning: mysql_numrows() expects parameter 1 to be resource, array given in C:\xampp\htdocs\a\Student_Home.php on line 13 here is the line 13... the LINE 5 is the LINE 13. include 'Connect.php'; $student_id = htmlentities($_REQUEST['id'], ENT_QUOTES); $result = mysql_query("SELECT * FROM student_information where student_id='$_GET[id]'"); $data = mysql_fetch_array($result); $numRows = mysql_numrows($data); $i = 0; Please advise what is wrong. Kindly edit my codes.

Member Avatar
Member Avatar
+0 forum 2

I have the following code, and i am having these errors: "Warning: mysql_fetch_array() expects parameter 1 to be resource, integer given in C:\xampp\htdocs\fyp\qmc-login\login.php on line 58 Warning: mysql_fetch_array() expects parameter 1 to be resource, integer given in C:\xampp\htdocs\fyp\qmc-login\login.php on line 59" Can somebuddy find out whats the problem? Thanks in advance. <?php session_start(); ?> <?php include_once("../includes/connection.php"); ?> <!DOCTYPE html> <html lang='en'> <head> <meta charset="UTF-8" /> <title> HTML Document Structure </title> <link rel="stylesheet" type="text/css" href="style.css" /> </head> <body> <div id="wrapper"> <?php $current_page = $_SERVER['PHP_SELF']; ?> <form name="login-form" class="login-form" action= "<?php echo $current_page; ?>" method="post"> <div class="header"> <h1>Login Form</h1> <span>Fill out the …

Member Avatar
Member Avatar
+0 forum 3

hi someone tell me how to define Notice: Undefined index: id in C:\xampp\htdocs\invoice\getcheckno.php on line 6 Notice: Undefined index: taxrate in C:\xampp\htdocs\invoice\getcheckno.php on line 7

Member Avatar
Member Avatar
+0 forum 2

Hey guys I have found this code to create a quiz, I'm getting the following errors when I try and add a question Warning: require_once(scripts/connect_db.php): failed to open stream: No such file or directory in C:\xampp\htdocs\addQuestions.php on line 33 Fatal error: require_once(): Failed opening required 'scripts/connect_db.php' (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\addQuestions.php on line 33 <?php if(isset($_POST['desc'])){ if(!isset($_POST['iscorrect']) || $_POST['iscorrect'] == ""){ echo "Sorry, important data to submit your question is missing. Please press back in your browser and try again and make sure you select a correct answer for the question."; exit(); } if(!isset($_POST['type']) || $_POST['type'] == ""){ echo "Sorry, there was …

Member Avatar
Member Avatar
+0 forum 3

hey guys so im trying to delete a row using checkbox but i get an undefined index error = Notice: Undefined index: check in D:\Xampp\htdocs\EMS2\event.php . i think its because the checkbox is echoed(?)maybe? or is it something else that i overlooked? <tbody class="tbody-event-list-table2"> <?php require "connection.php"; $check = mysql_query("SELECT * FROM event") or die(mysql_error()); if(mysql_num_rows($check) > 0) { while($row = mysql_fetch_array($check)) { $id = $row['event_id']; $name = $row['event_name']; $start = $row['start']; $end = $row['end']; $venue = $row['event_venue']; echo "<tr> <td><input type='checkbox' name='check' id='check' class='check' value='$id'/><a href='' class='event-link'>$name</a></td><td>$start</td><td>$end</td><td>$venue</td>"; ?> <?php if(isset($_POST['del_event'])) { if(count($_POST['check']) !=0) { $array = array("check" => $_POST['check']); …

Member Avatar
Member Avatar
+0 forum 4

Hello. I have a two problems with my Regsystem. 1st. **Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\mycms\reg.php:229) in C:\xampp\htdocs\mycms\reg.php on line 266** 2nd: When i Register a user - system message "Username already exist" not "Registration succesfull".. this is the code of register.php <?php require 'core/init.php'; $general->logged_in_protect(); if (isset($_POST['submit'])) { if(empty($_POST['username']) || empty($_POST['password']) || empty($_POST['email'])){ $errors[] = 'All fields are required.'; }else{ if ($users->user_exists($_POST['username']) === true) { $errors[] = 'That username already exists'; // ALWAYS TYPED THIS } if(!ctype_alnum($_POST['username'])){ $errors[] = 'Please enter a username with only alphabets and numbers'; } if (strlen($_POST['password']) …

Member Avatar
Member Avatar
+0 forum 7

Hiy guys alot of you have been brilliant over the past few days. I'm creating my own website and I want to let users register and log in, into the site I'm now getting this error message Warning: mysqli_query(): Couldn't fetch mysqli in C:\xampp\htdocs\submit-form.php on line 19 The following SQL Failed INSERT INTO 'users' (`firstname`, `lastname`, `username`, `confirmusername`, `password`, `confirmpassword`, `email` ,`confirmemail`) VALUES ('richard', 'Hemmings', 'hemmo001', 'password', 'password', 'richardgwhemmings@msn.com' , 'richardgwhemmings@msn.com') <?php //select your database //$b=mysql_select_db("database_name",$a); $firstname=$_POST['firstname']; $lastname=$_POST['lastname']; $username=$_POST['username']; //$confirmusername=$_POST['confirmusername']; $password=$_POST['password']; $confirmpassword=$_POST['confirmpassword']; $email=$_POST['email']; $confirmemail=$_POST['confirmemail']; //Database connection require_once("config.php"); //mysql query to insert value to database $query="INSERT INTO 'users' (`firstname`, `lastname`, `username`, …

Member Avatar
Member Avatar
+0 forum 13

Hi Guys as I have mentioned before I'm having problems with connecting my website to a sql database, config.php <?php ini_set('display_errors', true); // change to false when you go live error_reporting(E_ALL); //Mysql Connect | mysql_connect("host= 3306","username",""); //Below example to connect in localhost //$a=mysql_connect("localhost","root",""); if($a == false) { die("Connect failed: ".mysql_error()); } //select your database $b=mysql_select_db("database_name",$a); if($b == false) { die("DB select failed: ".mysql_error()); } ?> submit_form.php <?php //select your database //$b=mysql_select_db("database_name",$a); $firstname=$_POST['firstname']; $lastname=$_POST['lastname']; $username=$_POST['username']; //$confirmusername=$_POST['confirmusername']; $password=$_POST['password']; $confirmpassword=$_POST['confirmpassword']; $email=$_POST['email']; $confirmemail=$_POST['confirmemail']; //Database connection require_once("config.php"); //mysql query to insert value to database $query=mysql_query("INSERT INTO registration (`firstname`, `lastname`, `username`, `confirmusername`, `password`, `confirmpassword`, `email` ,`confirmemail`) …

Member Avatar
Member Avatar
+0 forum 20

I have set up a data base called assignment with a table called 'Parts' in it. But when i run the follwoing code on my local host i get the following error "Warning: mysqli_fetch_array() expects parameter 1 to be mysqli_result, boolean given in /Applications/XAMPP/xamppfiles/htdocs/lab9.php on line 8". Can anyone help me fix this and help me print out the contents of the table. <html> <head> <?php $con = mysqli_connect("localhost", "root","","Assignment"); echo '<table border="1">'."\n"; $result = mysqli_query($con,"SELECT * FROM user"); while ( $row = mysqli_fetch_array($result)) { echo("</tr><td>"); echo(htmlentities($row[0])); echo("</td><td>"); echo(htmlentities($row[1])); echo("</td><td>"); echo(htmlentities($row[2])); echo("</td><td>"); echo(htmlentities($row[3])); echo("</td><td>"); echo(htmlentities($row[4])); echo("</td><td>\n"); echo('<a href="edit.php?id=' .htmlentities($row[0]).' ">Edit</a> …

Member Avatar
Member Avatar
+0 forum 2

Hi Guys I'm connecting to a database using PHP and MYSQL, here is the code <?php $firstname=$_POST['firstname']; $lastname=$_POST['lastname']; $username=$_POST['username']; $confirmusername=$_POST['confirmusername']; $password=$_POST['password']; $confirmpassword=$_POST['confirmpassword']; $email=$_POST['email']; $confirmemail=$_POST['confirmemail']; //Database connection require_once("config.php"); //mysql query to insert value to database $query=mysql_query("INSERT INTO registration (`firstname`, `lastname`, `username`, `confirmusername`, `password`, `confirmpassword`, `email` ,`confirmemail`) VALUES ('$firstname', '$lastname', '$username' , '$confirmusername' , '$password', '$confirmpassword', '$email' , '$confirmemail')); //if value inserted successyully disply success message //if($query) { echo 'Registred successfully..!!</div>'; }else { //error message echo '<unable to registred !!</div>'; } ?> When I click on submit I get the following error Parse error: syntax error, unexpected end of file in C:\xampp\htdocs\submit-form.php …

Member Avatar
Member Avatar
+0 forum 13

Hello guys, I need your Help, why i can get this warning? Warning: Cannot modify header information - headers already sent by (output started at C:\xampp\htdocs\OJT\FINAL\profile.php:112) in C:\xampp\htdocs\OJT\FINAL\profile.php on line 122 this is my code <?php $member_id=mysql_real_escape_string($_SESSION['id']); $result=mysql_query("select * from user where id='$member_id'")or die(mysql_error); $row=mysql_fetch_array($result); $username=$row['UserName']; $FullName=$row['FullName']; $image1=$row['img']; header("Content-Type: image/jpeg"); echo $image1; ?> Thanks

Member Avatar
Member Avatar
+0 forum 7

Hi Guys, Can you Tell Me What is the wrong of my Code. This is my Code. I am Using DOM Extension! <?php require_once("dompdf/dompdf_config.inc.php"); $conexion = mysql_connect("localhost","root",""); mysql_select_db("evaluation",$conexion); $codeHTML=' <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>Download</title> <link href="css/style.css" rel="stylesheet"> </head> <body> <div align="center"> <table border="1" class="rating"> <tr> <th bgcolor="#0099FF">CORE VALUES</th> <th bgcolor="#0099FF">BEHAVIORAL INDICATORS</th> <th bgcolor="#0099FF">RATING</th> <th bgcolor="#0099FF">OVERALL</th> <th bgcolor="#0099FF">PERCENTAGE</th> </tr>'; $codeHTML.=' if( isset($_POST['trate1']) AND isset($_POST['trate2']) AND isset($_POST['trate3']) AND isset($_POST['trate4']) AND isset($_POST['trate5']) ) { teamwork = $_POST['trate1'] + $_POST['trate2'] + $_POST['trate3'] + $_POST['trate4'] + $_POST['trate5']; $t1 = $_POST['trate1'] * 100; $t2 …

Member Avatar
Member Avatar
+0 forum 1

Hi, I have a site that looks fine locally, but when I view it online, it gets messed up. Specifically, it does not resize correctly (eg at 800x600). In a turnabout, this only occurs in Firefox (3.6.16) - in IE 8 it resizes ok. To further confuse the matter, if I put the files on a [I]different[/I] server, it looks fine! Here is the site in question on Server 1: [URL="http://www.lincolnavenuewillowglen.com/nonprofits.html"]http://www.lincolnavenuewillowglen.com/nonprofits.html[/URL] Resizing doesn't work here. Also note that image at top-left does not resize correctly either. Here is the site on Server 2 (identical html and css): [URL="http://www.rudeshoes.com/nonprofits.html"]http://www.rudeshoes.com/nonprofits.html[/URL] This should …

Member Avatar
Member Avatar
+0 forum 7

The End.