hello. I have a table populated by name. The names are links when clicked will pop up a form for editing. each input (for editing) is populated by the equal value from database but im having trouble with one particular text box. this text box is for date of birth and it only shows part of the data. for example in the database dob is 2 January 1993 in the popped up form it only shows 2. the rest of the input are fine and display full data its just this one. php code: <?php $contact = $_GET['contact']; require "connection.php"; …

Member Avatar
Member Avatar
+0 forum 13

#include <iostream> #include <cstdlib> using namespace std; // function prototype for add int add (int x, int y); int sub (int q, int r); int mul (int s, int t); int divi (int u, int v); int main () { int a,b; char ch; loop:cout<<"ENTER CHOICE OF OPERATION: + - OR * / and q to quit"; cout<<'\n'; cin>>ch; int result; if(ch!='+'&&ch!='-'&&ch!='*'&&ch!='/'&&ch!='q') { cout<<"wrong input"; } else { if(ch=='+') { result = add( a, b ); } else if(ch=='-') { result=sub(a,b); } else if(ch=='*') { result=mul(a,b); } else if(ch=='/') { result=divi(a,b); } else if(ch=='q') { exit(0); } cout<<"enter 1st number"; …

Member Avatar
Member Avatar
+0 forum 2

I need to make one statement to select either of the items in listbox and show the same label, regardless of which item is selected. I've tried someting like If Me.ListBox1.SelectedItem = "R115" Or "Bay, Charles" Then Label1.Text = "Address Information Avaliable" End If But it doesn't work. The code below works but I need to make it shorter. If Me.ListBox1.SelectedItem = "R115" Or Me.ListBox1.SelectedItem = "Bay, Charles" Then Label1.Text = "Address Information Avaliable" End If Any suggestions?

Member Avatar
Member Avatar
+0 forum 2

Hi! Can anyone know the result of this query: SELECT COALESCE(MAX(ID),0) + 1 FROM Table123

Member Avatar
Member Avatar
+0 forum 3

Hello, so I was trying few relations between tables and I noted an unexpected behaviour when using `group_concat()`. Let say I have three tables: fruits, fruitstock and fruitprices. These are the structures: create table fruits ( id tinyint unsigned not null auto_increment primary key, name varchar(50) not null, quality varchar(50) not null ) engine = myisam default charset = utf8; create table fruitstock ( id tinyint unsigned auto_increment primary key not null, fruit_id tinyint unsigned not null, quantity tinyint unsigned not null default 0 ) engine = myisam default charset = utf8; create table fruitprices ( id tinyint unsigned not …

Member Avatar
Member Avatar
+1 forum 1

can someone help me to find out why my label display is listing the result of the textboxes instead of adding up the values of the text boxes? here are my codes: Dim strstudentName As String = (" ") Dim dblAssignment1 As Double Dim dblAssignment2 As Double Dim dblAssignment3 As Double Dim dblAssignment4 As Double Dim dblMidterm As Double Dim dblFinalExam As Double strstudentName = (txtStudentName.Text) dblAssignment1 = (txtAssignment1.Text) dblAssignment2 = (txtAssignment2.Text) dblAssignment3 = (txtAssignment3.Text) dblAssignment4 = (txtAssignment4.Text) dblMidterm = (txtMidterm.Text) dblFinalExam = (txtFinalExam.Text) lblFinal.Text = "Final Grade is: " + (txtAssignment1.Text + txtAssignment2.Text + txtAssignment3.Text + txtAssignment4.Text + txtMidterm.Text …

Member Avatar
Member Avatar
+0 forum 2

<?php $username = $_SESSION['username']; $result = 'sample'; $con = mysql_connect("localhost","root",""); if (!$con) { die('Could not connect: ' . mysql_error()); } $sql = "Select FirstName from Person Where LoginID = (Select LoginID from UserLogin Where Username = '$username')"; $result = mysql_query($sql,$con); echo $result; ?> I'm kinda new to this server-side scripting language (php) and I've been burning the midnight oil trying to figure out, how to get my single value result to display... perhaps any of you out there could help me solve this problem? I would appreciate all the help I can get.

Member Avatar
Member Avatar
+0 forum 7

I am making a mysql query that gathers comments for a user, it works properly, I connect to the database and recieve the comments for a user, but it is not showing the first comment for the user. Here is the code function comments(){ //connect to db connect_db_members(); //start query global $number; $query = "SELECT * FROM comments WHERE commentie='$number' ORDER BY id DESC"; //run query $results = mysql_query($query); //check if there are no comments if(mysql_fetch_array($results) == ""){ echo '<div class="comments_about_wrapper"> <div class="comment_text_wrapper"> <div class="comment_text" ><p style="font-size:29px;">You have no comments</p> </div> </div> </div>'; } else {while($row = mysql_fetch_array($results)){ echo '<div …

Member Avatar
Member Avatar
+0 forum 4

>Hi guys,..i've two arrray data1 and data2 then i do intersect to get same value between data1 and data2, and >use count to get total same value,..how to ARSORT count result from intersect array multidimensional? <?php $data1 = array( array( '7' => 'chelsea everton', '8' => 'everton villa', '9' => 'villa liverpool', '10' => 'liverpool manutd' ), array( '23' => 'milan inter ', '24' => 'inter juventus', '25' => 'juventus napoli', ), array( '53' => 'chelsea everton', '54' => 'barcelona altetico', '55' => 'altetico getafe', '56' => 'everton villa', ) ); $data2 = array( array( '3' => 'milan inter', '4' …

Member Avatar
Member Avatar
+0 forum 2

Hi every one!! I need help to match user data from database inorder to log in to admin panel. Here is what I am trying. it works ok but it is giving dialog box containing text "Sorry! You have no access to Database" here is the code. Please help String user = jTextField1.getText(); String pwd = new String(jPasswordField1.getPassword()); while (rs.next()) { String uname = rs.getString("User name"); //Username is the coloumn name in the database table String password = rs.getString("Password"); if ((user.equals(uname)) && (pwd.equals(password))) { admin_panel p = new admin_panel(); p.setVisible(true); } else if ((!user.equals(uname)) && (!pwd.equals(password))) { // System.out.println("Sorry! You …

Member Avatar
Member Avatar
+0 forum 5

i have writeen following query in my code. $tquery="SELECT questions.id,questions.date,questions.title,users.user_name,subjects.subject FROM questions INNER JOIN users ON questions.student_id=users.id INNER JOIN topics ON questions.topic_id=topics.id INNER JOIN subjects ON topics.subject_id=subjects.id WHERE subjects.id=".$_SESSION['sub1']." OR subjects.id=".$_SESSION['sub2'].";"; but when i am trying to echoing its result it is not displaying anything.

Member Avatar
Member Avatar
+0 forum 4

Hello, I want to combine all my database table in to one line so i can put it all in the url e.g. Name | Times __________________________ test1 | 1 __________________________ test2 | 2 __________________________ This is how i want it to look in the url (Result.php?loggedin=true&links=test1-1_newline_test2-2)(_newline_ means that will be a break point when the other page receives is links) NOTE: After the script retreves the data i'm using header('Location: page') to send the data to the result.php page.

Member Avatar
Member Avatar
+0 forum 2

HI. I've tried other codes, but they don't seem to work. What I'm trying to do, is grab a result from google's shopping page, and display it on my page. I only want the title, which is in the tag:[CODE]<h3 class="result-title">TITLE</h3>[/CODE] How do I do that in PHP? Thanks!

Member Avatar
Member Avatar
+0 forum 6

Hi All Im trying to get this to work, but can only get it to work without putting the form tags in, and wont work with more than one set of the inputs. the below is the result when i use ajax to search for item names, then want to caluculate the quantity * length (for total quantity), then total quantity * rrp_exc. the result should show in the the total field. It works, but not if the form tags are in and if there are multiple rows of the below inputs, eg, when there is more than one item …

Member Avatar
Member Avatar
+0 forum 3

Hi all, I am new to php and I have a problem that I am looking into it for 1 day and can't understand it please help. here is my html code : <html> <head> <title> Calculation Form </title> </head> <body> <form action=calculate.php method="POST"> value one: <input type="text" name"val1" size=10 /><br /> value two: <input type="text" name"val2" size=10 /><br /> <p>Calculation:<br> <input type="radio" name="calc" value="add"> add<br> <input type="radio" name="calc" value="subtract"> subtract<br> <input type="radio" name="calc" value="multiply"> multiply<br> <input type="radio" name="calc" value="devide"> devide</p> <p><input type="submit" name="submit" value="calculate"></p> </form> </body> </html> It calls the calculate.php it has 2 text boxes and 4 radio …

Member Avatar
Member Avatar
+0 forum 4

Hi Everyone, I have been trying to understand mysql a little further - with some small steps in the right direction. but I have come across a problem I am unable to fix / get working. I have a form, that has a variable $country - I am trying to get the sms text message price for the varible $country Below is my attempt - to get the sms price (table field name (price) from tbl (sms_prices)) (table field name (name) from tbl (sms_countries)) [code] $query = "select c.country_id, c.name, p.price from sms_countries c, sms_prices p where c.name = '$country' …

Member Avatar
Member Avatar
+0 forum 2

I'm stumped as to why this might be happening. A website I had completed for a client over a year ago, was working fine until a couple of days ago when the web host went and moved the site onto a new server without warning any of their customers (myself included). This caused errors with the database connections etc., but that was all easily fixed. Now something strange is happening though - one of my bigger INNER JOIN queries (which was working fine) is suddenly returning empty results. I had a quick search and found that this was happening for …

Member Avatar
Member Avatar
+0 forum 3

Hi Everyone- We are building a database that needs table(purchaser) to check table(paypal) for a matching telephone number. Table(paypal) has 'purchaser telephone' as PK and table(purchaser) has 'purchaser telephone' as FK. I can insert and see the data in both tables, but running a select query returns an empty result. The format for datasets in both tables is decimal(19,5) to allow for international numbers and a 5 digit extension. We are running innodb. We have also tried it with email addresses and got the same (they are varchar). The queries that return empty are below. [CODE] SELECT purchaser telephone FROM …

Member Avatar
Member Avatar
+0 forum 6

HELP!! I try to bind a textbox to a datatable but i cant.. I checked if the datatable is filled (it includes the results of a sql query)and it s ok.. i can depict the result in a combo box but not in textbox. I wait for only one result that s why i need textbox instead of combo.. that s my code.. i m desperate .. [CODE]Dim StateTable As New DataTable StateTable.Clear() ' Dim ds As New DataSet Dim sqlCmd As New SqlCommand("select DISTINCT State_LCL from T_MUNICIPALITY,T_MUNICIPALITY_STREETS where T_MUNICIPALITY.Municipality_LCL=T_MUNICIPALITY_STREETS.Municipality_LCL and T_MUNICIPALITY_STREETS.Municipality_LCL='" & txtMunicipality.Text & "'", conn) Dim StateDA As …

Member Avatar
Member Avatar
+0 forum 4

Okay, So I want an array to get userinformation by the username that is provided. But in the other tables, it only has a ID field to link with... [CODE]$sql = "mos_users.id as userid, block, username, email, lastvisitDate, firstname, lastname, avatar, cb_age, userip FROM mos_users, mos_comprofiler, mos_comprofiler_plug_iplog WHERE mos_users.username = '". $user."' AND mos_comprofiler.user_id = (SELECT id FROM mos_users WHERE username = '".$user."') AND mos_comprofiler_plug_iplog.userid = (SELECT id FROM mos_users WHERE username = '".$user."')";[/CODE] Below is the query that works, if I give in the ID , I get all the information I want [CODE]$sql = "SELECT mos_users.id as userid, …

Member Avatar
Member Avatar
+0 forum 5

hi guys having a problem getting a single value from a mysql query getting all sorts of problems - heres my latest version below [code=php]mysql_connect($host,$user,$password) or die( "Unable to select database"); mysql_select_db("mydatabase"); // select database to use. $user = 84; $sql1="SELECT `order_id` FROM `table1` WHERE `user_id`= '$user'"; $array = mysql_fetch_array('$sql1'); $sqlres1 = $array[order_id]; echo $user; $sql2="UPDATE `table2` Set `order_status` = 'C' WHERE `order_id` = '$sqlres1' And `order_status` = 'P'"; mysql_query($sql2); echo $sql2; mysql_close(); echo "Successfully completed"; [/code] basically i want to get the value returned from $sql1 and use it as part of $sql2 - i'm getting a Warning: mysql_fetch_array(): …

Member Avatar
Member Avatar
+0 forum 3

The End.