php - How can I fix this HREF issue -


I'm battling a problem with which I need some help, basically I've created a search bar And when the results come I only want 'session 1' or 'session 2' to be href. Not a complete thing

echo & lt; P & gt; & Lt; A href = '.. / pages / session.php & lt; / A & gt; ". $ [[1 ']] result.' '& Gt; & lt; h3 & gt; $ Result ['title'] "& lt; / h3 & gt; $ Result ['text'] .. "& Lt; / p & gt;";

Link to my DB

Note that not all of my codes are located, where I believe the problem lies.

You have & lt; / A & gt; A bit wrong is the right solution would be:

  echo & lt; P & gt; & Lt; A href = '.. / pages / session.php' & gt; {$ Result ['1']} & lt; / A & gt; & Lt; H3 & gt; {$ Result ['title']} & lt; / H3 & gt; {$ Result ['text']} & lt; / P & gt; ";  

If you use double quotation marks, you do not need to add the variable to your string, they are also valid within the string.


UPDATE

To display only headlines in the form of links:

  echo "& lt; A href = '.. / pages / session.php' & gt; & Lt; H3 & gt; {$ Result ['title']} & lt; / H3 & gt; & Lt; / A & gt; & Lt; P & gt; {$ Result ['text']} & lt; / P & gt; ";  

Comments

Popular posts from this blog

java - org.apache.http.ProtocolException: Target host is not specified -

java - Gradle dependencies: compile project by relative path -

ruby on rails - Object doesn't support #inspect when used with .include -