i want to make comment box in my own site so i have to make database online but it shows some error, Please help me.!! this is the code <?php $comment = $_POST['comment']; $submit = $_POST['submit']; if($submit) { if($name&&$comment) { $con= mysql_connect("localhost", "root",""); if($con) { $query="create schema IF NOT EXISTS comments;"; mysql_select_db("comments"); $query="create table comment(id int NOT NULL AUTO_INCREAMENT, primary key(id),name varchar(50), comment varchar(300));"; $insert=mysql_query("insert into comment(name, comment) values('$_POST[name]', '$_POST[comment]')"); mysql_select_db("comments"); $query="select * from comment"; $res=mysql_query($query); echo"<table>"; while($row=mysql_fetch_array($res)) { echo "<tr> <td><p></p></td> <tr>"; echo "<tr> <td><id>$row[id]</id></td> <td><left>$row[name]</left></td> <tr>"; echo "<tr> <td></td> <td><left1>$row[comment]</left1></td> <td><p></p></td> <tr>"; } echo "</table>"; } } } …

Member Avatar
Member Avatar
+0 forum 4

hello friends, What is the difference between Mysql_fetch_object and mysql_fetch_array ?

Member Avatar
Member Avatar
+0 forum 4

Hey everyone, I have just uploaded my php files onto a free hosting server and tried to access the website. I got this error " mysql_fetch_array() expects a resource in parameter 1" or something like that. By the way, the files did work on my local machine. What is the problem? and how do I go about fixing it?

Member Avatar
Member Avatar
+0 forum 4

**Okay, first of all, I'm quite new to programming at this level. I have managed to create a dynamic administrationpanel for updating the current menues of a restaurants homepage.** ISSUE - The more posts in the table, the longer the space between the page top and the databasetable gets. I’ve tried about everything, and as you can see, the table that is beneath had the same range between the arrows as shown - until I deleted all but two posts. I can’t understand why that happens, please help me to understand the issue. I want the top table to act …

Member Avatar
Member Avatar
+0 forum 3

hey people please tell me what to do , when ever i use mysql_fetch_array(data) i get this error : [CODE] Warning: mysql_fetch_array() expects parameter 1 to be resource, null given in C:\xampp\htdocs\awah.biz2\classes\class_lib.php on line 34 [/CODE] please tell me what to do , here is the class_lib.php: [CODE] <?php class db { var $do; function __construct() { } function connect() { mysql_connect("localhost","root","")or die("cant connect to MySQL server : ".mysql_error()); } function select() { mysql_select_db("awah7870_index") or die("cant select the db : ".$select); } function query($data) { $q = mysql_query($data); if($q) { echo ""; } else { echo "Error : ".mysql_error(); } …

Member Avatar
Member Avatar
+0 forum 2

I wanna to know the difference between mysql_fetch_Assoc and mysql_fetch_Array..I am a little bit confused at its usage..Kindly provide with a sample example also...Any help would be appreciated

Member Avatar
Member Avatar
+0 forum 2

Hi, I'm a bit of a noob with PHP. I am trying to retrieve information from multiple tables with the following code [CODE] <?php function check_input($id) { // Stripslashes if (get_magic_quotes_gpc()) { $id = stripslashes($id); } // Quote if not a number if (!is_numeric($id)) { $id = "'" . mysql_real_escape_string($id) . "'"; } return $id; } include 'private/auth.php'; //sql login file if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("$database"); $id=$_GET["id"]; $id=check_input($id); $query="SELECT * FROM products WHERE id=$id"; $result=mysql_query($query); while($row = mysql_fetch_array($result)) { echo "<table>"; echo "<tr><td colspan=2><h3>" . $row['Name'] . " - " . $row['Referance'] . "</h3></td></tr>"; …

Member Avatar
Member Avatar
+0 forum 2

category_manager.php [CODE] <?php //LOAD USER $result = mysql_query("SELECT * FROM kategori_berita"); while ($data = mysql_fetch_array($result)){ ?> <tr> <td><?php echo $data['kategori'];?></td> <td> <a href="./category_manager.php?id=<?php echo $data['id']; ?>&mode=delete">Hapus</a> | <a href="./category_manager.php?id=<?php echo $data['id']; ?>&mode=edit">Edit</a> </td> </tr> <?php [/CODE] Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given in C:\xampp\htdocs\php_template2\category_manager.php on line 127 What should I do so that the error would not appear. Thanks.

Member Avatar
Member Avatar
+0 forum 7

I'm sure this is stupidly simple, but I havent been able to figure it out with lots of Google searching and pouring through tutorials. I'm building a simple computer trade-in value calculator PHP app. Using a form to select the type of computer and the various specs, I need it to connect to the database that contains the modifier values for each selected component. Then all the modifier values are multiplied against the max value to calculate the trade-in value. Desirable brands and features have higher modifier values, eg. HP = 0.95 vs Acer = 0.7 or Core i7 = …

Member Avatar
Member Avatar
+0 forum 1

Hey all. First post ;) and since i've used this site a lot for help i think its about time i registered and joined up. Im not new to programming but i am new with php + database manipulation. [CODE] $app = mysql_query("SELECT * FROM applicant_classinfo WHERE appid='".$_GET['id']."' AND '".$_GET['cname']."'"); [/CODE] That is my mysql statement and what i try to get values out of it using [code] $info = mysql_fetch_array($app); [/code] [code] echo $info['dualspec'] ; [/code] the above statement doesn't display anything. you guys know whats is causing it?

Member Avatar
Member Avatar
+0 forum 3

hi, please help this problem , iwill used query after while condition this will not run the program.

Member Avatar
Member Avatar
+0 forum 2

Hi, I`ve started doing PHP and MYSQL for a few months now and I am working on a project for a friend. Basically I had the code written down in mysql format and decided to change my code too mysqli. Everything was working fine except for one function. I keep getting this error [B]Warning: mysqli_fetch_array() [function.mysqli-fetch-array]: Couldn't fetch mysqli_result [/B]. Here`s my code connect to database [CODE] //DEFINE etc... function connect(){ //global $dbc; $dbc = mysqli_connect(HOST, USERNAME, PASSWORD, DB) or die('Cannot connect to MySQL! '.mysqli_connect_error()); return $dbc; } [/CODE] update function [CODE] function update_emp_job_position($emp_id, $job_id) { $dbc=connect(); // Turn autocommit …

Member Avatar
Member Avatar
+0 forum 6

Hiya All, Not sure if i should be putting thi up on the SQL section but i think the problem lies in the PHP part of my code. This is what i've got. I'm counting the number of times a category shows up in my database returning the name of that category with the count next to it. I'm printing the first 5 results individually then putting the rest into a dropdown box (order by count) My problem is there is a category missing (schools__30) which would be the 6th result in line i.e. the first to appear in the …

Member Avatar
Member Avatar
+0 forum 4

The End.