Jump to content

[SOLVED] Very Quick One


herghost

Recommended Posts

I have made a big mistake, I have had a pint and now can not work out why the flip this will not work, I know its simple, i have had it working before  :(

 

a href='http://www.ticketmaster.com/search?q=
<?php
$sql = "SELECT * FROM user WHERE userid = '$userid'";$result = mysql_query($sql) or die(mysql_error());while($row = mysql_fetch_array($result)){ {  echo $row['bandname'];   }}?>"
>Go!</a>

 

Its just meant to search for ticketmaster.com/search?q=bandname

Link to comment
https://forums.phpfreaks.com/topic/154576-solved-very-quick-one/
Share on other sites

Well now, if he's that drunk, we might as well spell out the whole sentence not just one of the words in it.

 

$query = "SELECT * FROM user WHERE userid = '$userid'";
$result = mysql_query($query) or die(mysql_error());

while($row = mysql_fetch_array($result)) {
   echo '<a href="ticketmaster.com/search?q='.$row['bandname'].'">Go!</a>';
}

Well now, if he's that drunk, we might as well spell out the whole sentence not just one of the words in it.

 

Lol.  herghost, you need to learn to properly indent and format your code, this will help with debugging.

 

The code you posted only looks like bits and pieces of the 'real' code.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.