10,940 Topics
| |
<?php echo "<html> <head><title>comment box</title></head> <body> <hr width=1000>"; require('connect.php'); if(isset($_POST['submit'])) { $name = $_POST['name']; $comment = $_POST['comment']; echo "<font color=white><center>"; $result= mysql_query(" INSERT INTO COMMENT (name,comment) VALUES ('$name','$comment')") or die(mysql_error()); while($row = mysql_fetch_array($result)) { echo "<tr> <th>ID</th> <th>Name</th> <th>Comment</th></tr>"; echo "<tr>"; echo '<td>' . $row['name'] . '</td>'; echo '<td>' . … | |
Hi friends! i have a drop down combo box which holds names of persons with php mysql order by asc query like a's name put in 1st and after b's and c's and in last it shows z's name now i want that if it will show tahir name in … | |
$dbQuery="select id, name from artists where name like '$keyword%' order by name asc limit 15"; $dbResult=mysql_query($dbQuery); echo mysql_num_rows($dbResult)."\n"; while ($dbRow=mysql_fetch_array($dbResult)) { // for each artist, return the number of albums belonging to that artist // use a separate query here to obtain the number // return the number after the … | |
Guys I am having a problem on how can I display array of records using mysql_num_rows, I cant use mysql_fetch_array because the format like this [CODE]$row['MR_no'];[/CODE] that encloses the name of the field inside brackets in my SQL codes this is my codes: [CODE]<?php $username = $_SESSION['username']; $query = "select … | |
please help me to this issue. its driving me nuts for an hour :( Warning: mysql_fetch_array(): supplied argument is not a valid MySQL result resource in /hermes/bosweb/web033/b336/ipg.asiahomecom/tile/tilesCollection.php on line 16 my line 16 code: while($row=mysql_fetch_array($a)){ my code.. --------------------tileVerification.php---------------------- <?php session_start(); if (!$_SESSION['user']){ header('location: tiles.php'); exit(); } ?> ---------------------connectionIn.php------------------------- $con = … | |
I have a project in which i have two roles : Student Teacher I have already created a login page but i cant figure out how to redirect them to different pages according to their Roles... | |
Hey got a big issue i need to resolve if i have a table that records two distinct values entered by user.. NC001 OR TE001 Equipment_id | Serial | location -------------------------------- NC001 | if i have a php based form how can i tell it that if a user select … | |
Hello, Pls i developed a php application and i would like to limit the number of row entries into a table in my database and the number of rows displayed from that table. i am a beginner:$ | |
Hi All, I'm working on a database wherein I want to input the current date into existing table upon the user enter his pin. I'm having a hard time to make it work here is my code. [CODE] <?php $result="SELECT * FROM profiletable WHERE (firstName='$_POST[assetSearch]' || lastName='$_POST[assetSearch]' || IDNumber='$_POST[assetSearch]')"; $q … | |
I've created this function and I wonder if ever I COULD USE VARIABLES IN reading column values on database table. [CODE] function vote($column, $imgid)//the $column stands for a variable handling a string I've passed from my previous call. For now I am setting it as a string named "likes" which … | |
Hello !! I need help fot the following situation: I have 2 tables: test1 and test2: each one have the same columns name: data test1: column data values (black, white) test2: column data values(white,black,orange, yellow) what sql sentence i can use to show only the values (orange, yellow) the difference … | |
After INSERTing record(s) to payments_table (from paypal IPN), $query = "SELECT sum(payments) FROM payments_table WHERE customer_id='{$customer_ID}'"; $result = mysql_query($query); //get the value from result here $query = "SELECT customer_id FROM discounts_table WHERE customer_id='{$customer_ID}'"; $result = mysql_query($query); //if row > 1 //loop until reached a certain condition THEN genarate a NEW … | |
Hi! I have a table for payments what I want to accomplish is: once a certain customer Id reached a certain amount by his accumulated payment, it will trigger an insert into statement to my discount table to generate a code specifically for him. i understand thats trigger is only … | |
Hi all I have following table structure [CODE] pk_cat_id(int) cat_name(varchar) cat_desc(text) fk_cat_id(int) [/CODE] table is self related as one to many i want to select cat_name, cat_desc and parent_cat_name() i.e. from fk_cat_id, how i can get cat_name | |
Hi I am trying to cross join 3 tables and use the values from this to calculate cumulative Accuracy for each student. But I am missing some students name when they dont have values in one of the tables. Eg: [CODE]mysql_connect(localhost,$username,$password); @mysql_select_db($database) or die( "Unable to select database"); // to … | |
Hi We have a competition running that I would like to automate getting the results with PHP from my MYSQL DB. I can run a query on the Database to get the following results Consultant1 20 sales Consultant2 10 sales Consultant3 5 sales Consultant4 1 sales Consultant5 3 sales Consultant6 … | |
I'm Beginner. I need help, please. I am having a small problem in the script I am have in this script ( admin folder) Add contain articles (This page is working to add threads only) My problem in the Page (read_mor.php) i make a query with the database to bring … | |
Hello, i have a problem with my query. any body give suggestion please. i have two tables named as "users" and "userimages" in the users table there are 1)userid (primary key) 2)name 3)subscription package (Brong or gold) and in the next table "userimages" fields are 1)auto_id 2)userid (foreign key) 3)image … | |
Please help me i having this problem, Current is my code: error at line "if(mysql_num_rows($result)!=0)" function getNewID($init,$field,$table) { $num = rand(1,100000000); $act_id = $init.$num; $query = "SELECT $field FROM $table WHERE $field = '$act_id'"; $result = mysql_db_query("ssimage_db", $query); if(mysql_num_rows($result)!=0) { $exist = true; } else{ $exist = false; } while($exist) … | |
Dear All, I have a system with the web server(apache) and db(mysql) server install on separate machines. So at times when the traffic is high I can not access my system. So first I would like to know where is the error and where is the error log file will … | |
can anybody help me how I can use four tables at the same time with different conditions to fetch records from my database? this is my sql code that im trying to modify because this is only for two tables: [CODE] <?php session_start(); if (isset($_SESSION['username'])) { include("database.php"); $username = $_SESSION['username']; … | |
Hi Guys, I willing to hear your suggestions and advice regarding a problem of DB design in MySQL. The situation is that I need to develop a DB design which brings High Performance under the following conditions: + There will be 10000 users that will consump and generate data. + … | |
lastlogin is getting saved as time() in my mysql table and it is varchar mode. querying the database to send out emails to remind my users that they have not logged in from past 30 days SELECT * FROM members WHERE lastlogin = DATE_SUB(CURDATE(), INTERVAL 30 DAY) i tried with … | |
Hi friend, I want to use connector for mysql data base. I am follow this page [url]http://dev.mysql.com/tech-resources/articles/mysql-connector-cpp.html[/url] But it seems hard . Is there any other tutorial present. Please let me know. | |
This is something I can't find any data on. I've got two database. Database one has a list in it. Database 2 has a list in it as well. I am needing to delete all the entries from database 1 that database 2 also contains. So if database one had … | |
Hello again I have two questions regarding the REPLACE command. The first query I am running is [CODE]update phpbb_posts set post_text = replace(post_text, '[del]', '[ b][ i]') update phpbb_posts set post_text = replace(post_text, '[/del]', '[/i][/b]')[/CODE] Note - in the above code I have had to add a space before the … | |
Heyy guys, need some help here...the thing i'm suppose to do is, update a value for a single row, but currently its updating the value for all the row... [CODE] <?php session_start(); $host="localhost"; // Host name $username=""; // Mysql username $password=""; // Mysql password $db_name="test"; // Database name $tbl_name="testing3"; // … | |
why is it sometimes i get an error? it doesn't highlight the error [B]CODE[/B] [CODE]Dim SqlQuery As String = "Select UserName from Login" Dim SqlAdapter As New MySqlDataAdapter Dim SqlCommand As New MySqlCommand Dim Ds As New DataSet Dim i As Integer With SqlCommand .CommandText = SqlQuery .Connection = sConnect … | |
Hi, I am trying to transfer values in one table to a new table with a different structure. The current table has 3 fields id, content_id and value and for each content_id there are several records. I would like to transfer the values for each content_id to just 1 record … |
The End.