I have three tables i want to search for customer data depending on the equipment type. $test = "SELECT custid, equipment FROM customer WHERE custid='$id'"; $data = @mysqli_query ($dbcon, $test); $equip = mysqli_fetch_array($data, MYSQLI_ASSOC); if($equip['equipment'] = "cellphone" ){ // Make the query: $q = "SELECT custid, cdate, custName, customer.equipment, customer.manufacturer, customer.model, customer.imei, notes, workdesc, hardware, status, cost, pickup_date FROM customer INNER JOIN cellrepair ON customer.custid=cellrepair.cust_id WHERE custid='$id'"; $result = @mysqli_query ($dbcon, $q); // Run the query. $members = mysqli_num_rows($result); if ($result) { // If it ran OK, display the records. // Table header. echo '<table id="result"> <tr> <th><b>ID</b></th> <th><b>Date</b></th> <th><b>Name</b></th> …

Member Avatar
Member Avatar
+0 forum 2

Hi Guys I wrote simple PHP script for get value from URL and check similar values from the database. This is a code <?php include('../../datab.php'); if(!empty($_GET['ip'])) { $ip = $_GET['ip']; $ipcheck = mysql_query("SELECT * FROM `report` WHERE `ip`='$ip'"); if(mysql_num_rows($ipcheck)> 0) { while($row = mysql_fetch_array($ipcheck)){ ?> <body> <p>Report ID : <?php echo $row['id'] ?></p> <?php } else { echo "Nothing Selected"; } }} ?> </body> But Dreamviewer shows there is a error in `else`part after the <p>Report ID : <?php echo $row['id'] ?></p> <?php } lines, (see attachment 01) Whats wrong with my code?

Member Avatar
Member Avatar
+0 forum 9

I have a table that logs customer data but i want to search for the customer, upon finding that customer i want to click on the name and find it in another table that store other data. But here is where i am stuck i want to check which table the record is in and then display it. Is there anyway to do that. like using an IF statement or case. The criteria would be based on equipment type as the two other table stores data based on the type of equipment. Any help or reference would be good

Member Avatar
Member Avatar
+0 forum 2

This is the project I need to finish. I am fairly new to php and this project has got me confused. Any help would be greatly appreciated The project ask for to validate ISBN 10 Number. There would be 10 digits with 1-9 being Numbers, but Number 10 is an x. This is What I have so far: This is the input page or html page: <form method="POST" action="Process10ISBN.php"> <p>Enter ISBN 10: <input type="text" name="isbn10" /></p> <input type="submit" name="Submit" value="Submit" /> </form> This is what I have so far for the Procssing page to validate ISBN 10: if (empty($_POST['isbn10'])) echo …

Member Avatar
Member Avatar
+0 forum 6

HI, I am a beginner at programing and I have to do this project where it is asking me to validate any ISBN 13 number. I know how to set up the input page, but I am having or you could say no Idea how to validate a number if user inputs data in the input page. I have some code below that I think it should be included, but if someone has better way to do it then I would be appreciate it. here is the input page code: <form method="POST" action="Process_isbn13.php"> <p>Enter the ISBN 13: <input type="text" name="isbn13"/></p> …

Member Avatar
Member Avatar
+0 forum 5

I want to send an email only if the field name 'Active' has changed in my database table bus_status.. It is a boolean field (TRUE or FALSE) so if it is False and changes to TRUE upon update I want it to send the email or if is TRUE and it is changed to false on update then I want it to send the email. This code was placed into a HOOK file that has a function started called After_Update which is triggered after the record is changed. If I just remove the first two lines of this code it …

Member Avatar
Member Avatar
+0 forum 1

Alright I apologize for the completely uninformative title but i had no idea what to call it. Basically I have an array with multiple values and I only want information to be sent from certain forms if a certain value is met in the array. <?php if(isset($_POST['cb1'])) { $cb1 = implode(",", $_POST['cb1']); } else { $cb1 = ""; } ?> <?php if(isset($_POST['cb2'])) { $cb2 = implode(",", $_POST['cb2']); } else { $cb2 = ""; } ?> <?php if(isset($_POST['tutor'])) { $tutor = implode(",", $_POST['tutor']); } else { $tutor = ""; } ?> <?php $con = mysqli_connect("localhost","root","admin","form_info"); if (mysqli_connect_errno()) { echo "Failed to …

Member Avatar
Member Avatar
+0 forum 5

This is the project I need to finish. I am fairly new to php and this project has got me confused. Any help would be greatly appreciated I am trying to do a Web form that is taking an online order form! This is What I have so far: This is the input page or html page: <form method="POST" action="OnlineOrders.php"> <table border=0> <tr> <td width=260>NameE<br /></td> <td width=295>Descripation<br /></td> <td width=45>Price<br /></td> <td width=35>Quanity<br /></td> </tr> <tr> <td>Shirts</td> <td>Red</td> <td align="right">$11.50</td> <td align="center"><input type="text" name="shirt" size="3" maxlength="3" /></td> </tr> <tr> <td>Pants</td> <td>blue</td> <td align="right">$23.99</td> <td align="center"><input type="text" name="pants" size="3" maxlength="3" …

Member Avatar
Member Avatar
+0 forum 3

The following code is producing this error `Microsoft VBScript compilation error 800a03f6 Expected End ` followed by `/stock/availability-quick/availability2.asp, line 130` I think it is a if else error. I have looked over the code and i don't see the error and would benefit from an expert pair of eyes to look over it. Thanks in advance David <%@LANGUAGE="VBSCRIPT"%> <!--#include file="../../includes/functions/insphire.asp"--> <!--#include file="../../includes/functions/logaccess.asp"--> <!--#include file="../../includes/functions/stock.asp"--> <% if request("Allow") = "f875eba08594178509bd3482dc0294" then ' security check passed %> <!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" lang="en" xml:lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" /> <title>Administration - Stock - Status</title> </head> <body> …

Member Avatar
+0 forum 0

Write a program to get 3 numbers from user for integer variable a, b,and c. if a is not zero, find out whether it is the common divisor of b and c.

Member Avatar
Member Avatar
+0 forum 3

So I actually posted this in the C# section, but despite peoples best efforts, all all the help there, the problem is still not solved. Background: Im making a game in xna/c# (Who isnt these days). For collision detection, I though I would use rectangles and lists. My thought process was: 1. Load collision map file 2. Parse file, where there is a 1, create a rectangle and add to list 3. In the player class, iterate through the list of rectangles (I called the list 'badTiles') 4. If the player intersects one of the rectangles, prevent them from moving, …

Member Avatar
Member Avatar
+0 forum 3

So everything works right now, but I need that final section (will be turned into a function later) to display the number of A's, B's, C's, D's, and F's. It seems like it should be pretty simple, but nothing is working for me. Thanks! #include <iostream> using std::cout; using std::cin; using std::endl; int main() { int scores[10], average = 0, grade [10]; double score = 0; for ( int i = 0; i < 10; i++ ) { cout << "Enter Student #" << i + 1 << "'s score: "; cin >> scores[i]; score = scores[i]; if ( score …

Member Avatar
Member Avatar
+0 forum 1

I need to find a digit at a specific postion in a number. Example number 652796, user inputs a 4, "2" is displayed. I have the basis for it, but most of the time, the output is incorrect. Not sure what's wrong. #include <iostream> #include <cmath> using std::cout; using std::cin; int main () { int number = 0, digits = 0, position = 0, result = 0; cout << "Enter a number: "; cin >> number; cout << "Enter a digit position:"; cin >> position; if ( 0 == number) { cout << "0"; } while (position-- > 1) { …

Member Avatar
Member Avatar
+0 forum 2

I am trying to combine cells depending on the contents of other cells. If Column A has an "X", I want to combine all cells below it, values seperated with a space, until the next line where an "X" appears. There is also data in Column C, which I don't want to be deleted as a result of the above named merge, but preserved in the row which its original associated data was merged. See below for the example of before and after. BEFORE MACRO A B C x 1 cat 2 dogs Title A 3 monkeys 4 kitten x …

Member Avatar
+0 forum 0

For the if discriminant < 0 statement, I need to not only display the error message, but I must display the complex roots in the correct format for complex numbers. How should I go about that? #include <iostream> #include <cmath> using std::cout; using std::cin; int main() { int a = 0, b = 0, c = 0, x1 = 0, x2 = 0, discriminant = 0; cout <<"Enter value for A: "; cin >> a; cout <<"Enter value for B: "; cin >> b; cout <<"Enter value for C: "; cin >> c; x1 = (-b + sqrt ((b * …

Member Avatar
Member Avatar
+0 forum 2

Hi all, I have to update some classic ASP code and I need to add an if statment to compare if a uppercase value is == "N/A" and to compare value with request("productLink") line 8 and if it is it should by pass validation on line 16. Any further information required please let me know Thanks in advance David <%@LANGUAGE="VBSCRIPT"%> <!--#include file="../../includes/functions/insphire.asp"--> <!--#include file="../../includes/functions/stock.asp"--> <!--#include file="../../includes/functions/logaccess.asp"--> <% if request("Allow") = "f875eba085941cc78509bd3482dc0294" then ' security check passed categorycodeSQL = "SELECT StockExpectedCategoryCode FROM StockExpectedCategories WHERE StockExpectedCategoryProductID = '" & replace(request("ProductLink"), "heaters", "heater") & "'" set rowCategoryCode = returnrecordsetstock(categorycodeSQL) if not rowCategoryCode.eof then …

Member Avatar
Member Avatar
+0 forum 3

This program is supposed to run through the menus to eventually display the area or volume of a shape depending on the user's menu choices and input. However, it won't run the final menu and I'm not sure why. There aren't any problems when it goes through the debugger, it just doesn't run the whole program. I tried to change my last level switches to if statements but it didn't change anything. Any ideas? #include <iostream> using std::cout; using std::cin; int main() { int menuitem = 0, areamenuitem = 0, volumemenuitem = 0, base = 0, height = 0, radius …

Member Avatar
Member Avatar
+0 forum 3

I want to make and If statement which will work when a double "credits" is between 1 and 9. But I'm not sure how to. Will If (1 <= credits => 9) Then Work?

Member Avatar
Member Avatar
+0 forum 3

I am a newbie to python so exude the not so well constructed code.. I have two text files. The first one (WordFile1.txt) is " John Mary Joe alice William ….." The second (SearchText.txt) is "JOHN EGGS,24,BEEF,36,BACON,56,HAM,66 ALICE TOMATOES,16,HAM,35,BEANS,35" ……." If my response number is 2 I will get BEEF and HAM stored… no problem. I want to store in the names NOT in the SearchText.txt (Mary Joe William) to Dumptext.txt but my second "if" statement is stuck in the loop. Please help. Thanks for supporting newbies! # respNum = raw_input("What is the response number: " ,) def read_words(words_file): with …

Member Avatar
Member Avatar
+0 forum 7

Hello, This if statement is always returning true and I cannot see why. Could you guys tell me why? menu = input("Choose what you would like to do:\n\n1. Work out how far you will travel with a set time and speed\n2. Work out the speed you will need to travel to do a certain distance in a specific time.\nChoice: ") if(int(menu) != 1 or int(menu) != 2): print("Error. Enter 1 or 2.") menu = input("Choose what you would like to do:\n\n1. Work out how far you will travel with a set time and speed\n2. Work out the speed you will …

Member Avatar
Member Avatar
+0 forum 3

class Timerange{ public: Start_time start; End_time end; Timerange(string initstring){ //initstring xx:xx X, x:x //X->weekday string current=""; unsigned short mode=0; string timeA; string weekday; string timeB; for(unsigned short i = 0; i<initstring.length(); i++) { char c = initstring[i]; if (c==' '){ if (mode==0) timeA = current; else if (mode==1) weekday = current; else if (mode==2) timeB = current; mode++; current =""; }; else{ //here current+=c; }; }; }; }; it gives me error: 'else' without previous 'if'' but there is an if! What's going on?

Member Avatar
Member Avatar
+0 forum 1

![3a451fbd93eb17f84f06c7ac648bdcab](/attachments/small/2/3a451fbd93eb17f84f06c7ac648bdcab.PNG "align-left") I need to create this program for class. I'm not looking for the answer. I'm simply confused on how to create a batch file where I input a number and it gives me an option. Would I use the IF command if so how would I do it. My teacher is awful and he doesn't explain anything. Here is what I got so far @ECHO OFF ECHO This BAT file will display the symbol of your choice Echo. ECHO 1. Stars ECHO 2. Dollars ECHO 3. Pluses ECHO e. Exit Program ECHO. ECHO Enter your choice (1, 2, …

Member Avatar
Member Avatar
+0 forum 9

How To Determine The Best Score? I am doing a lab regarding 'guess number game' Actually,the answer should be the random number,but I set the exact number to 88,because it is easy for me to test other requirement. I need to printf("Best Score so far [X]") How to make comparison between the previous and now guess game,and define the best score. #include <stdio.h> int main() { int GusNum,TotalNum,BesSor,a; char again; do { TotalNum=0; do { printf("Guess what the lucky number is <between 1 and 100>,then <Enter>:"); scanf("%d",&GusNum); if(GusNum>=89&&GusNum<=100) printf("The number you typed is [%d] -Too LARGE,guess the lucky number again!\n\n",GusNum); …

Member Avatar
Member Avatar
+0 forum 3

i wantto builda GPA in C# and want to a condtion which chek the value from user input. chek it if it is greater then 70 show A GRADE greater then 50 show B GRADE like and print it and also set is this char type value to switch and calculate the piont like /* switch(GRADE) { case 'A': points = hours * 4; break; case 'B': points = hours * 3; break; } Consol.WriteLine(GRADE); Consol.WriteLine(GPA); */this just an idea

Member Avatar
Member Avatar
+0 forum 3

Hello! I'm having a rather difficult time because the concepts weren't very much explained in class for complex situations. I'm a bit entangled with the few if-else conditions I have... :( I've been trying hard to crack the case, but I think somebody really needs to see my work. Write a menu driven program for the following options using ladderized if-else statement: a. To find whether the number is odd or even. b. To display sum of input five numbers. c. Exit.

Member Avatar
Member Avatar
+0 forum 4

The below code displays correctly, I need an "IF" statement that prevents displaying rows with 0% in the percent column and I've tried several conditions. None are working. I only want to display rows that has at least 1% in the percent column. Here is the code: $result = mysql_query("SELECT user8, concat(round(count( * ) *100 / (SELECT count( * ) FROM `lm_users`)) , \"%\") AS percent FROM `lm_users` GROUP BY user8 "); while ($row = mysql_fetch_array($result)) for ($i=0; $i<mysql_num_fields($result); $i++) echo $row[$i] . " "; echo "<br>"; Any help would be appreciated.

Member Avatar
Member Avatar
+0 forum 3

Hello, help me please. I have a db sample ( http://i.imgur.com/JRZ2ojP.png ) I have 1 combobox and 1 textbox If the combobox select "Notebook" then on the textbox it must be display the corresponding itemStock (3) Please :( By the this my simple code for my combobox Try Query = "SELECT * FROM tbl_items" MySqlCommand = New MySqlCommand(Query, CNN) MySqlDataReader = MySqlCommand.ExecuteReader combItems.Items.Clear() Do While MySqlDataReader.Read combItems.Items.Add(MySqlDataReader(1)) Loop End If Catch ex As Exception MessageBox.Show(ex.ToString, "Message", MessageBoxButtons.OK, MessageBoxIcon.Error) Finally MySqlDataReader.Close() End Try

Member Avatar
Member Avatar
+0 forum 1

I'm trying to create a game of Go Fish in Python. But I've stumbled onto a little problem that I can't seem to figure out how to deal with. There is a human player (player 0) and three computer players (from 1-3). The human player goes first and chooses a target player. And then a card rank (for example, the player could target player two and choose jacks, then the computer would have to give the player all its jacks). What I have so far is below but the problem I'm having is right at the bottom of the code. …

Member Avatar
Member Avatar
+0 forum 3

I am having trouble getting started with my program. I have writen the array but I am having trouble starting the if statemnent to fill the seats in the program. If they press 1 it needs to fill seats 1 through 5 if they press 2 it needs to fill seats 6 through 9. it cannot fill the same seat twice and if one section is filled it needs to go to the next. Any help would be appreciated. public class { final static int QUIT = 3 static Scanner console = new Scanner(System.in); public static void main(String[] args) { …

Member Avatar
Member Avatar
+0 forum 1

So here is what I want. if (tracks, the db) (user_id, the row) for '".$_SESSION['user']['id']."' = equal (tracks, row) in (users, the db) for '".$_SESSION['user']['id']."' exit else update (users, the db) (tracks, the row) to match. This isn't the script as I don't know where to start but I am looking on how to do this to no anvil, another solution is when my insert script is done and is successful then update another table in the db but I also wouldn't know where to start that :/ any help greatly appreciated!

Member Avatar
Member Avatar
+0 forum 1

The End.