擅长:python、mysql、java
<blockquote>
<p>I don't know how to embed Python code in PHP this python code</p>
</blockquote>
<pre><code>
#! /usr/bin/python
import sqlite3
db = sqlite3.connect("vt.db")
cr = db.cursor()
icerik = ""
sql_sorgusu = db.execute("SELECT * FROM icerik").fetchall()
for i in sql_sorgusu:
if len(i) >= 1:
icerik += f"""
<div class="article">
<img src='+ {str(i[3])}' alt="Bilişim Hukuku" class="img">
<a href="" class="categori">Bilişim Hukuku</a>
<br>
<h3 class="articleh3"> {str(i[1])}</h3>
<a href='/blog.html?id= {str(i[0])}'>Devamını oku</a>
</div>
"""
else:
print("not SQL match !")
print(icerik) # complete html code
</code></pre>