PHP - Moved: $sql Echo Not Working
This topic has been moved to MySQL Help.
http://www.phpfreaks.com/forums/index.php?topic=320829.0 Similar Tutorialsecho will not print out a value. I do the simple string " " and it doesn't even do that. It's just blank in my browser. I use netbeans and firefox and chrome. Any idea as to what I'm doing wrong? Simple code snippet: <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/> <title>PHP Testing</title> </head> <body> <?php echo "print me"; ?> </body> </html> Thanks for any future help. hi there all. hope i can get your help. i am creating a php page that talks to mysql tabes. i want to print query into my html page inside html tags. the first echo in my code works but the one embedded inside the html code prints nothing to the page. look at my code if it helps: <html><body> <?php mysql_connect("localhost", "root", "123456") or die("Connection Failed"); mysql_select_db("man_utd")or die("Connection Failed"); $name = $_POST['members']; $query = "select * from members where username = 'burns'"; $result = mysql_query($query); while ($line = mysql_fetch_array($result, MYSQL_ASSOC)) { echo $line['pass']; } ?> <table border="0" cellspacing="2" cellpadding="2"> <tr> <th><font face="Arial, Helvetica, sans-serif"><?php echo $line['pass']; ?></font></th> <th><font face="Arial, Helvetica, sans-serif">Value2</font></th> <th><font face="Arial, Helvetica, sans-serif">Value3</font></th> <th><font face="Arial, Helvetica, sans-serif">Value4</font></th> <th><font face="Arial, Helvetica, sans-serif">Value5</font></th> </tr> </body> </html> thanks all for any help This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=347290.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=352201.0 Please help, when I run this search and enter something in the search thats not in the database, it doesnt reply with "Your query returned 0 results" as it should. I tjust stays blank Here's the section of code in question... if ($search) // perform search only if a string was entered. { mysql_connect($host, $user, $pass) or die ("Problem connecting to Database"); $srch="%".$search."%"; $query = "select * from tvads WHERE advert LIKE '$srch' ORDER BY advert, year DESC, details ASC LIMIT 0,30"; $result = mysql_db_query("cookuk_pn", $query); if ($result) { $count = 1; print "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" bordercolor=\"#0000FF\" width=\"900\">"; print "<tr><td width=\"200\" height=\"30\" align=\"left\"><u><b><font face=\"arial\" size=\"2\" color=\"#800080\">Advert / Description</font></b></u></td>"; print "<td width=\"80\" align=\"left\"><u><b><font face=\"arial\" size=\"2\" color=\"#800080\">Year</font></b></u></td>"; print "<td width=\"200\" align=\"left\"><u><b><font face=\"arial\" size=\"2\" color=\"#800080\">Artist</font></b></u></td>"; print "<td width=\"200\" align=\"left\"><u><b><font face=\"arial\" size=\"2\" color=\"#800080\">Track</font></b></u></td>"; print "<td width=\"80\" align=\"left\"><u><b><font face=\"arial\" size=\"2\" color=\"#800080\">Buy Album</font></b></u></td>"; print "<td width=\"100\" align=\"left\"><u><b><font face=\"arial\" size=\"2\" color=\"#800080\">Download MP3</font></b></u></td></tr>"; while ($row = mysql_fetch_array($result)) { // Begin while $data .= "<td width=\"200\" height=\"30\" align=\"left\"><font face=\"arial\" size=\"1\">" .$row['advert']. "</font><br>"; $data .= "<font face=\"arial\" size=\"1\" color=\"#000080\"><i>" .$row['details']. "</i></font></td>"; $data .= "<td width=\"80\" height=\"30\" align=\"left\"><font face=\"arial\" size=\"1\">" .$row['year']. "</font></td>"; $data .= "<td width=\"200\" height=\"30\" align=\"left\"><font face=\"arial\" size=\"1\">" .$row['artist']. "</font></td>"; $data .= "<td width=\"200\" height=\"30\" align=\"left\"><font face=\"arial\" size=\"1\">" .$row['track']. "</font></td>"; $data .= "<td width=\"80\" height=\"30\" align=\"left\"><font face=\"arial\" size=\"1\">" .$row['asin_ref']. "</font></td>"; $data .= "<td width=\"100\" height=\"30\" align=\"left\"><font face=\"arial\" size=\"1\">" .$row['mp3_ref']. "</font></td></tr>"; $count++; } // end while $data .="</table>"; echo $data; } else { echo "problems...."; } } else { echo "Your query returned 0 Results"; } ?> My variable which should be storing XML data and echos it to the screen is echoing the data as a string without the XML structure Below is my code but it is still not working: Code: [Select] $view = $_GET['view']; $xml_data = "http://www.website.com/STRATA/" . $view .".xml"; $handle = fopen($xml_data, 'r'); $Data = fread($handle, 10000); fclose($handle); echo $Data; Hello all, I'm passing variables through a URL. This will work: echo $v4; But neither of these will: echo "<a href='test.php?v4=$v4'>Places</a>"; echo "<a href='test.php?v4=".$v4."> Places</a>"; It WILL work if I hardcode v4, like so: echo "<a href='test.php?v4=Utah'>Places</a>"; But that's useless to me, as I don't want to have to write 50 If statements for every database entry. Does anyone know how to fix this? Thanks! This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=343671.0 This topic has been moved to Other Libraries and Frameworks. http://www.phpfreaks.com/forums/index.php?topic=306490.0 This topic has been moved to PHP Applications. http://www.phpfreaks.com/forums/index.php?topic=348171.0 Hi, Im trying to pull an email from an url, and then echo the email as value into a email form-- under the "from" heading. The echo is not working i get blanks. here is the code: <?php $thisurl='$_SERVER['REQUEST_URI']'; $thepart = explode('/', $thisurl); $themail='$thepart[2]'; ?> <form method="post" action="sendit.php"> To: <br><input type="text" name="to" size="44" value="<?php for($i=1; $i<=$lines; $i=$i+1) { $names[$i] = str_replace("<br>", "", $names[$i]); $names[$i] = str_replace("\n", "", $names[$i]); echo $names[$i].';'; } ?>"><br> From: <br><input type="text" name="email" size="44" value="<?php echo '$themail'; ?>" readonly><br> Subject: <br><input type="text" name="subject" size="44" /><br><br> Hi, This is my first post in this forum and am a PHP beginner. I have written a script in php and need to use echo to see the values of variables etc. However I dont get the output on the screen while using echo . I am using Xampp server with Apache. The startup.html file code is
<!DOCTYPE HTML>
</head>
and the test.php code is <?php
$lat = $_REQUEST['latitude'];
echo 'latitude- '.$lat . ', longitude- ' . $lon; Please help regards
Sanjish OK, have no idea what's going on... I've done this a million times... why wont this output!?? I must have a major brain meltdown and dont know it yet!!! Code: [Select] <?php // this echoes just fine: echo $_POST['testfield']; // but this wont echo: echo if (isset($_POST['testfield'])) { $_POST['testfield'] = $test; } echo $test; /// or even this DOESNT echo either!: $_POST['testfield'] = $test; echo $test; ?> This topic has been moved to Installation in Windows. http://www.phpfreaks.com/forums/index.php?topic=326869.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=318036.0 This topic has been moved to HTML Help. http://www.phpfreaks.com/forums/index.php?topic=342956.0 This topic has been moved to MySQL Help. http://www.phpfreaks.com/forums/index.php?topic=306850.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=351390.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=319472.0 This topic has been moved to JavaScript Help. http://www.phpfreaks.com/forums/index.php?topic=308359.0 |