Questions tagged [query]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0
votes
0answers
45 views

How do I create an advanced query page using HTML and CSS? Should I use any other langauges to make it a faster process?

How do I create an advanced query in HTML and CSS? I have to create a front end similar to Google and have already outfitted the first two pages, it's the 3rd page, the advanced query page that I need ...
0
votes
1answer
161 views

Search function - Pset8 - Mashup

I found the search query a little bit complicated, in the sense it can be difficult to adjust it to the user's input. For example, how do I permit the user to enter the parameters in different order ...
0
votes
1answer
51 views

CS50 Understanding Technology Progress

Hi I've finished CS50 over two weeks ago and I haven't received a message from the CS50 bot regarding my progress or results. What can be done? I'm eager to receive my certificate.
0
votes
1answer
137 views

SQL SELECT query

Sorry if this is a novice error but I had some problems with SELECT. I executed a query for retrieving all the stocks, which were purchased by a user, in a database called portfolio. 'Usernamer' is a ...
0
votes
1answer
41 views

PSET6 Parse Segmentation Fault

My parse code seems to work fine but after it runs there is a segmentation fault. It isn't any of the other methods, and I just can't figure out why it is doing this. I think it has something to do ...
0
votes
0answers
67 views

debugging cs50 finance query function (php)

I got this piece of piece code from csfinance from a few years ago. I was wondering how I can printf the error code on the very last else when the query gets returned as false? (for example if its a ...
0
votes
1answer
38 views

pset7 sell.php I seem to be missing something

I just finished sell.php, but I had to use $cash[0]["cash"], to get cash out of my query. This dos not feel right. The code works, but I feel it is wrong. Is there a better way to do this?? <?...
0
votes
1answer
52 views

pset6 How to tackle check50 on .php?name=Alice

I only have this one problem left in check50. https://sandbox.cs50.net/checks/e3382282d5e64259adec1cc4f51b17de I'm pretty sure the problem is in "load" (but, I could be wrong). I know it is tricky ...
0
votes
2answers
240 views

Pset7: Undefined offset in register.php

This pset is confusing and I'm completely lost. How can I fix this bug? Notice: Undefined offset: 0 in /home/ubuntu/workspace/pset7/public/register.php on line 39 The code: // Check if the ...
0
votes
2answers
320 views

Pset 7 | C$50 Finance: query() undefined in register.php

I'm having an issue with register.php. When I try to run the file on my web server and press submit (no matter the inputs) I get this fatal error message: ( ! ) Fatal error: Call to undefined ...
1
vote
1answer
136 views

Difference between CS50::query() and query()

I'm currently solving pset7 CS50 Finance. The query() function can be used as CS50::query() or simply query(). Both seem to work. So, is there any difference between the two approaches? Are there any ...
1
vote
1answer
85 views

Help with parse

I'm getting two errors with check 50 and am struggling to understand how to go about this. :( Requesting cat.exe returns error code 501 \ expected output, but not "HTTP/1.1 505 HTTP Version Not ...
0
votes
1answer
79 views

How should I connect to the multiple databases?

I am trying to Merge several psets. But to do that I think I need to have multiple databases. My dumbest approach to that problem follows like this in constants.php define("DATABASE", "pset7"); ...
0
votes
1answer
85 views

Pointer to char comes back empty

The parse function has 3 pointers that come into it; *line, *abs_path, and *query. I think I successfully manipulate the values at these addresses but when the function returns, *query is empty. *...
0
votes
1answer
461 views

Unable to use CS50::query() in import pset8

I had just implemented the import file for pset8 and was trying to run it and the following result was obtained. ./import ../US.txt PHP Fatal error: Class 'CS50' not found in /home/ubuntu/workspace/...
1
vote
1answer
153 views

How to query without CS50::Query()

I'm just thinking of what I do after cs50: I've completed pset7 already, but I'm eager to remake this pset without the use of CS50's library "Query" function. So my question would be how to replace $...
0
votes
1answer
722 views

PSET 7 Index.php Fatal error: Call to undefined function query()

Fatal error: Call to undefined function query() in /home/ubuntu/workspace/pset7/public/index.php on line 8. <?php // configuration require("../includes/config.php"); if(isset($_SESSION["id"])) { ...
0
votes
1answer
223 views

Help needed with query code for pset6

I have almost completed pset 6 but am having trouble with the php part in terms of the query not going through properly to the dynamic content string. Specifically the name. I copy the query to memory ...
0
votes
1answer
107 views

pset7 sell controller issue: undefined index

I have been working at trying to fix an issue I have been having with a variable. I keep getting an error for an undefined index for value on line 49: // update cash upon selling stock query("UPDATE ...
0
votes
1answer
34 views

Extract Query only works for certain string lengths

I'm trying to extract the query using functions that I've already used earlier in the program successfully (strchr and strncpy), but this code only seems to work for query strings that are 4 - 10 ...
0
votes
1answer
122 views

PSET6 checking the request-line

I'm trying to do the first part of pset6, but i always get a core when try to set query = '\0' in the case that there's no question mark and when there's a question mark followed by space, or by q ...
2
votes
2answers
180 views

PHP Fatal error: Column 'country_code' cannot be nullPHP Fatal error: Column 'country_code' cannot be null

I have seen that some fellows have been having this same problem, but I could not find the solution. My query seems ok until but it still return me this strange error foreach ($file as $row) { $...
0
votes
1answer
114 views

a problem with queries in sell.php

My problem is that whatever symbol I write in sell_form.php even if it doesn't exist in portfolio table, the query retursn true. Here's the query in sell.php and that's sell_form.php <form ...
3
votes
0answers
305 views

Match TWO letters with SQL query [closed]

This is not really a question but I was struggling to match two letter words using MATCH AGAINST and other people might find this useful. MySQL is configured to take only words with a minimum length ...
0
votes
1answer
406 views

pset8 query function

I've gotten import.php working - enough to print out the values in US.txt correctly in arrays onto the screen. I'm using the below code to try and insert into database: if(is_readable($...
0
votes
1answer
1k views

PSET8 - MASHUP : Can't find FULLTEXT indexes when using WITH QUERY EXPANSION

I'm working on the final pset, more specifically on the search.php file. I've figured out how to use query() and I'm actually taking advantage of print(json_encode($places, JSON_PRETTY_PRINT)); to ...
0
votes
1answer
91 views

a question about(extracting queries and extensions in a request line )

I am trying to extract the query and the extension from request-line but i don't know what's the maximum length of a query and a file extension so that I can know the size of the char array to store ...
0
votes
1answer
168 views

PSET6 Web Server: Static contents work while dynamic leads to a seg fault

I've browsed the questions asked, many of them helped to fix my code but I'm facing a last challenge and I've no idea how to pass it. Every test made with "cat.jpg", "cat.html" or "hello.html" works ...
0
votes
2answers
186 views

pset7: query problem

When I try these with query function it is giving me an error: query("SELECT * FROM users WHERE username LIKE %?%", $_POST['username']); query("SELECT * FROM users WHERE username LIKE '%?%'", $_POST['...
0
votes
1answer
536 views

pset6 server.c extract query from request-target

Good afternoon everyone who is reached pset 6 :-) I got error which I could not understand. I'm splitting request target to several sub-strings. During my last operation when I'm validating query in ...
0
votes
1answer
128 views

Column count doesn't match value count at row 1

This is my code for buying stock in CS50 Finance. but it keeps returning the error that column count doesn't match value count at row 1. I cannot figure out why. There are 5 columns stated and also 5 ...
0
votes
1answer
208 views

pset7 unknown column in where clause

This throws an error saying YHOO is an unknown column...I thought 'symbol' was the column name in this query? $id = 6; $symbol = "YHOO"; $shares_query = query("SELECT shares FROM portfolio WHERE id = ...
1
vote
0answers
304 views

Update Cash in “sell.php” is Not Working

Everything is working file but the cash is not updating. I think its due to typecasting. The value for shares is an integer and price is a float-point integer but I'm confused as to how to cast them. ...
1
vote
1answer
608 views

What does query function returns actually?

I am unable to understand what does the query() function actually returns? The comments in functions.php say that it returns all row in result set. Please somebody explain to me what do the following ...
1
vote
2answers
121 views

pset7: query function arguments

In functions.php, the query function signature is such: function query(/* $sql [, ... ] */) I understand that the [,...] means optional arguements but I do not get why it is surrounded by the ...