Questions tagged [import]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
2
votes
2answers
3k views

Why can't I use get_int in python

when I run mario.py it gives me this error NameError: name 'get_int' is not defined. I don't know why. import cs50 def main(): while True: print("Height:") h = get_int() if h < 0 or ...
0
votes
0answers
34 views

Cannot import helpers in sentiments, pset6 [duplicate]

Question is identified as possible duplicate of IndexError in initial state of pset6 Sentiments, however, that question refers to an issue that's seen after running flask on unmodified distribution ...
0
votes
0answers
59 views

pset8 import: Driver error preventing me from even starting pset

I have been trying to import the US.txt file into mySQL using the code on import. I am able to log into PHPMyAdmin just fine, but when I run ./import US.txt, I get the following error: $ ./import US....
0
votes
1answer
99 views

pset8, import. Only even row numbers from US.txt are being written to db

I managed to import file from US.txt to places table and all seems ok, except that only rows from even numbers in file are being imported. Instead of 40975 rows I have 20487. I tried with while loop(...
0
votes
1answer
195 views

pset8 error in opening US.txt

In pset8 import file on running the command ./import /pset8/US.txt the file is not opening.I have tried many methods but the interpreter says the file does not exists, although I can clearly see it (...
1
vote
1answer
115 views

Pset8, Mashup, import, i have been seen this error

I really don't know what's wrong, will it be the permission? Any help is appreciated! ~/workspace/pset8/bin/ $ ./import US.txt PHP Warning: require(/..includes/config.php): failed to open stream: ...
0
votes
1answer
124 views

Pset 8 Mashup Import Issue (fgetcsv returns empty array)

I am working on Pset8 (AKA mashup) and have run into an issue with my import script. It turns out that I have an issue with the SQL query that I am doing to insert each line from my US.txt file. It ...
0
votes
1answer
51 views

Pset8 imports zero Lat Lng

I implemented my import function and it seemed to work, I went on implementing the rest of the pset(which I already have finished with some minor bugs) BUT I found that some of the rows in my table ...
0
votes
2answers
101 views

Pset8 - Import using PHP array

Here's a fragment of my code containing the elements pertinent to my question. I am trying to use a PHP data array to send data to the Import routine. I establish the array $keywords and apply ...
1
vote
2answers
170 views

Pset8 import undefined offset notice

I am getting these errors in the loop in running import from the command line and cant figure out why I am getting this and how to get rid of it PHP Notice: Undefined offset: 1 in /home/ubuntu/...
0
votes
1answer
100 views

PSET8: fopen() not working for import

For pset8, fopen() keeps returning FALSE. The relevant part of my code is below: #!/usr/bin/env php <?php $file = ($argv[1]); if(file_exists($file) == 0) { exit("File does not exist.\n"); } ...
1
vote
0answers
293 views

CS50 IDE give “no such file or directory” even when filepath is correct

When I trying to run my import file from pset8 from the command-line, I got the message "bash: ./import: No such file or directory". I double and triple checked that I was in the correct directory, ...
0
votes
1answer
143 views

'import' works: just 'latitude' and 'longitude' values are all 0.000?

'import' gets 'US.text' into 'places'. All values are correct, but 'longitude' and 'latitude'are all 0.0000; In 'places' I defined those as Decimals(7.4) specifying as 0.0000; What could have went ...
0
votes
1answer
149 views

How to fix “PHP parse error” when running import?

I get the following error. tried for 3 days to understand it, but no success: PHP Parse error: syntax error, unexpected '{' in /home/jharvard/vhosts/pset8/import on line 13. It's the very first ...
1
vote
1answer
50 views

ERROR RESOLVED:PHP Fatal error: Column 'country_code' cannot be null in /home/jharvard/vhosts/pset8/includes/functions.php on line 57

I have been working on this issue for the past few days. PHP Fatal error: Column 'country_code' cannot be null in /home/jharvard/vhosts/pset8/includes/functions.php on line 57 initially i had ...
0
votes
1answer
174 views

PSET8 import undefined offsets and fatal error

I've been trying to implement import and I've modified the file US.txt by replacing "\t" with " , " on each line just for a better practicality with my code. However, I receive the following error: ...
0
votes
1answer
258 views

PSET8 import fatal error

I've been trying to implement import and I've modified the file US.txt by replacing \t with " , " on each line just for a better practicality with my code. However, I receive the following error: ...
1
vote
3answers
150 views

Excel into MySQL

A website has a link to download an excel file. I need some of those columns in my MySQL database. Is there a relatively painless way to: 1. use phpmyadmin's import tab 2. use a method similar to ...
0
votes
1answer
173 views

pset8 import SQL error

I've got an error when querying to table, after handling the absence/presence of accuracy, it wrote 21817 lines, but then got an error. COUNTRY_CODE must no be null. Inspecting the database, i figured ...
0
votes
1answer
130 views

pset8 import imploding and exploding a line

i'm trying to import the txt file. Using fgetcsv a hole line is stored in a variable, then i imploded it, \t as pattern, bu that leads me an array with empty spaces (probably aditional tabs), so i don'...
0
votes
1answer
130 views

a problem with displaying the places table

i got (import) to work and i saw the first 30 rows of data displayed on the table then, something happened and i get the error Fatal error: Maximum execution time of 30 seconds exceeded in ...
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
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
0answers
554 views

When I run import I get errors

I am trying to run import, but I get an error: jharvard@appliance (~/vhosts/pset8/bin): ./import /path/to/US.txt Error: file /path/to/US.txt doesn't exist I was wondering if someone could help me ...
1
vote
1answer
1k views

Import for Mashup

My code works to import the data into mysql, but the command line is giving me an error: PHP Fatal error: Column 'country_code' cannot be null in /home/jharvard/vhosts/pset8/includes/functions.php ...