Posts

mysql - SQL Stored Procedure Syntax error missing 'end' -

i've been working on sql stored procedure , new process. i'm trying write procedure retrieves value 1 table , inserts part of new row. i'm using mysql workbench, , it's giving me error @ line where blockid = blk; as part of following code: create definer=`root`@`localhost` procedure `add_userblock`(in user int(11), in blk int(11)) begin -- determine how many blocks can add declare blocknum int default -1; select addcount blocknum block blockid = blk; -- determine if block exists user declare entryexists int default 0; select count(*) entryexists userblock blockid = blk , userid = user; if (entryexists = 0) -- new entry begin insert userblock (userid, blockid, num) values (user, blk, blocknum); select last_insert_id() 'id'; end else -- existing entry begin update userblock set num = (num + blocknum) ...

html5 - Creating a link from my DB saved text with PHP -

i bit stumped. want get "directory/filename space.pdf" db (done) create page displays list of available pdf's (here fault lies) $stringoptions= $stringoptions. "<li><a href=". rawurldecode ($row['doccontent']) .">". $row['docdata'] ."</a></li>"; display php page in html. (done) the links generated www.thedomain.com/documents/filename , rest with space.pdf lost. or creates link /documents/filename+with+a+space , .pdf cut off , domain lost. i tried encodeurl , rawencodeurl correlating rawdecodeurl , decodeurl functions url never created. have read php manual not enough coder see other functions could/should use. or direction please.

Sorting items in a text file in python -

i've been trying figure out how sort results in text file in order of test scores small task i'm doing using lambda sort function. i'm unsure if best way or not recommended me friend. the results entered text file so: text_file = open("results.txt", "a") text_file.write("\n") text_file.write(str(score)) text_file.write(" ") text_file.write(username) text_file.write(" ") text_file.write(userclass) text_file.close() my current sorting system looks this: with open("results.txt") inf: data = [] line in inf: line = line.split() if len(line)==4: data.append(line) = sorted(a, key=lambda x: x.modified, reverse=true) and text file looks this: 5 test b 4 test b 6 test c 7 test (score username userclass) i sort results in descending order score , i'm not sure correct way go it. thanks in advance. if need list element sublists, above answers ok...

Variable Name in SAS -

i have variable name called a_flag (1=y,0=n) . however, when try rename variable, sas says can't find variable. is variable name a_flag (1=y,0=n) or a_flag ? if variablename "a_flag (1=y,0=n)", need refer "a_flag (1=y,0=n)"n. e.g: proc freq; tables "a_flag (1=y,0=n)"n; run; you need validvarname=any option set in order work.

Getting data from a php file using Javascript and Ajax -

hi trying create survey personal project working on teach self web development. survey f1 website , want able ask users 5 questions , based on there answers want able tell them grand prix best suited them. my questions users are: what grand prix’s closest you? (i have given them option select 3 grand prix’s suing select boxes) what countries visit? (i have given them option select 2 countries suing select boxes) when available go grand prix (i have given them option select 3 months suing select boxes) what favorite team? (one option using select box) who favorite driver? (one option using select box) so far have created database tables countries, grand prix’s, months, teams , drives. i have survey.php file populates select boxes database. so question how create javascript file link php file populates select boxes input user , display result out refreshing page using ajax? my survey.php <?php $link = mysqli_connect("localhost","...

android - Cannot compile project after adding library -

i have added today library ( same gith developer branch there few things changed , wanted use both libraries ) after fixing have tryed run project , following error: error:execution failed task ':app:dexdebug'. > com.android.ide.common.process.processexception: org.gradle.process.internal.execexception: process 'command 'c:\program files\java\jdk1.8.0_40\bin\java.exe'' finished non-zero exit value 2 my gradle files are: apply plugin: 'com.android.application' android { compilesdkversion 22 buildtoolsversion "21.1.2" defaultconfig { applicationid "com.example.marian.digimusicstream" minsdkversion 14 targetsdkversion 22 versioncode 1 versionname "1.0" } buildtypes { release { minifyenabled false proguardfiles getdefaultproguardfile('proguard-android.txt'), 'proguard-rules.pro' } } } dependen...

localhost - I update my xampp and i face this errors Notice: Undefined variable: session in -

i update xampp , face errors notice: undefined variable: session in try php.ini no solution have more 30 scipts in localhost , want ignore errors. how can this put @ end of php.ini error_reporting = e_all & ~e_notice & ~e_deprecated & ~e_strict make right php.ini