2015-07-20 38 views
0

我需要從MySQL數據庫導入一些數據來分析和顯示使用Processing 我有PHP代碼來查詢和獲取來自MySQL的數據。有沒有什麼辦法可以從處理中調用我的PHP?感謝你的幫助。如何將數據從MySQL導入到使用PHP文件進行處理?

由於提前, Hasala

+0

u能調用的HTTP URL?如果是這樣,你在 – Drew

+0

@DrewPierce是的,我甚至可以調用一個http * .php文件。但我無法調用這個https:// * .php文件。 – Hasala

+0

這是一個套接字和流。不是一個優雅的協議ssl/tls引擎,這是肯定的 – Drew

回答

1

下面這是從互聯網上共挖走。如果它落在我的頭上,我不會知道處理。

所以是的,這似乎很有可能。

String ip="12.215.42.19"; 
String[] data=loadStrings("http://api.hostip.info/get_html.php?position=true&ip="+ip); 
//will give an array of strings, one per line e.g. 
/* 
data[0]="Country: UNITED STATES (US)" 
data[1]="City: Sugar Grove, IL" 
data[2]="" 
data[3]="Latitude: 41.7696" 
data[4]="Longitude: -88.4588" 
data[5]="IP: 12.215.42.19" 
*/ 

編輯: 假裝下面的.html是.PHP

String lines[] = loadStrings("http://processing.org/about/index.html"); 
println("there are " + lines.length + " lines"); 
for (int i = 0 ; i < lines.length; i++) { 
    println(lines[i]); 

來源:

https://processing.org/reference/loadStrings_.html

+0

我試着像你說的。但我得到一個錯誤,說javax.net.ssl.SSLProtocolException: 我的PHP是一個與https的鏈接,會是一個問題?當我從我的瀏覽器進行鏈接時,它將結果顯示爲字符串數組。可能是什麼問題? – Hasala

+0

很明顯,SSL妨礙了處理,無法握手 – Drew

+0

不幸的是,他們將語言命名爲他們所做的事情。打造谷歌搜索。這就像搜索''' – Drew

相關問題