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

GO: Serve static pages -

java - how to parse a JSON string into ObjectNode in Jackson? -

objective c - How to open front/back camera at the same time in iOS developing? -