Boxerman Posted April 13, 2009 Share Posted April 13, 2009 Hey guys im trying to enter this code... <?php $con = mysql_connect("localhost","*****","*****"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("movies", $con); $result = mysql_query("SELECT * FROM news"); while($row = mysql_fetch_assoc($result)){ echo '<div style="width:400px; padding:3px; margin-bottom:8px; float:left; clear:both;">'; echo '<div style="width:90px; float:left;">'; echo '<img src = "'.$row['image'].'" style="border:2px #333333 solid;">'; echo '</a>'; echo '</div>'; echo '<div style="width:300px; float:right;">'; echo '<h3>'.$row['title'].'</h3>'; echo $row['story']; echo '</div>'; echo '</div>'; } ?> but the outcome is this http://www.uksbestsite.com/movies/index.php?page=news the echos dont seem to be working :S this is the full file <?php if ( !defined( 'in_web' ) ) exit( 'Stop here !!!!!' ); unset($module); $module["text"] = support(); function support() { global $skn, $db, $Lang; $skn->set_file('support','news/news.php'); $con = mysql_connect("localhost","****","*****"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("movies", $con); $result = mysql_query("SELECT * FROM news"); while($row = mysql_fetch_assoc($result)){ echo '<div style="width:400px; padding:3px; margin-bottom:8px; float:left; clear:both;">'; echo '<div style="width:90px; float:left;">'; echo '<img src = "'.$row['image'].'" style="border:2px #333333 solid;">'; echo '</a>'; echo '</div>'; echo '<div style="width:300px; float:right;">'; echo '<h3>'.$row['title'].'</h3>'; echo $row['story']; echo '</div>'; echo '</div>'; } $skn->set_var('support_online' ,$Lang->Mtextkey('support_online','support_online')); $sql="SELECT * FROM tbl_site_info WHERE $Lang->LangRequirement('tbl_site_info')"; $item = $db->sql_get_first($sql); $skn->set_var('yahoo' ,$result['C_Yahoo']); $skn->set_var('skype' ,$result['C_Skype']); $html = $skn->output('support'); $skn->vreset(); return $html; } $Out->PrintModule($module["text"]); // -> Main ?> Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/ Share on other sites More sharing options...
Coreye Posted April 13, 2009 Share Posted April 13, 2009 Why do you have php code tags, , around your code on the site? [attachment deleted by admin] Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-808492 Share on other sites More sharing options...
Boxerman Posted April 13, 2009 Author Share Posted April 13, 2009 i was trying different stuff... check it now... Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-808494 Share on other sites More sharing options...
taquitosensei Posted April 13, 2009 Share Posted April 13, 2009 the code here is not the same code as on the site. On your site I have a feeling instead of <?php and ?>you have and so it's not parsing the php Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-808530 Share on other sites More sharing options...
Boxerman Posted April 13, 2009 Author Share Posted April 13, 2009 ive tryed both... they both dont work... what now? Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-808749 Share on other sites More sharing options...
Coreye Posted April 13, 2009 Share Posted April 13, 2009 ive tryed both... they both dont work... what now? What happens when you use <?php ?>? Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-808822 Share on other sites More sharing options...
Boxerman Posted April 13, 2009 Author Share Posted April 13, 2009 the same... Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-808856 Share on other sites More sharing options...
taquitosensei Posted April 13, 2009 Share Posted April 13, 2009 create a file called phpinfo.php with this only <?php phpinfo(); ?> upload that then browse to it and tell us what happens Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-808948 Share on other sites More sharing options...
Boxerman Posted April 14, 2009 Author Share Posted April 14, 2009 http://www.uksbestsite.com/movies/info.php Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-809371 Share on other sites More sharing options...
MasterACE14 Posted April 14, 2009 Share Posted April 14, 2009 after... <?php $result = mysql_query("SELECT * FROM news"); change it to... <?php $result = mysql_query("SELECT * FROM news") or die(mysql_error()); $num = mysql_num_rows($result); echo "<p><h1>".$num."</h1></p>"; and see what happens. Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-809372 Share on other sites More sharing options...
Boxerman Posted April 14, 2009 Author Share Posted April 14, 2009 http://www.uksbestsite.com/movies/index.php?page=news this is the code now... <?php $con = mysql_connect("localhost","*****","*****"); if (!$con) { die('Could not connect: ' . mysql_error()); } mysql_select_db("movies", $con); $result = mysql_query("SELECT * FROM news") or die(mysql_error()); $num = mysql_num_rows($result); echo "<p><h1>".$num."</h1></p>"; while($row = mysql_fetch_assoc($result)){ echo '<div style="width:400px; padding:3px; margin-bottom:8px; float:left; clear:both;">'; echo '<div style="width:90px; float:left;">'; echo '<img src = "'.$row['image'].'" style="border:2px #333333 solid;">'; echo '</a>'; echo '</div>'; echo '<div style="width:300px; float:right;">'; echo '<h3>'.$row['title'].'</h3>'; echo $row['story']; echo '</div>'; echo '</div>'; } ?> Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-809440 Share on other sites More sharing options...
MasterACE14 Posted April 14, 2009 Share Posted April 14, 2009 I don't get why your website is displaying... ".$num." ? something's not right with the settings somewhere. Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-809441 Share on other sites More sharing options...
Boxerman Posted April 14, 2009 Author Share Posted April 14, 2009 could it be using smarty? or some other coding? Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-809457 Share on other sites More sharing options...
MasterACE14 Posted April 14, 2009 Share Posted April 14, 2009 I'm assuming that this script is being included within your websites template. So the problem must be with another file that is included in the page. Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-809461 Share on other sites More sharing options...
Boxerman Posted April 14, 2009 Author Share Posted April 14, 2009 its using this kinda stuff $page->AddModule("center","news","news"); Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-809465 Share on other sites More sharing options...
MasterACE14 Posted April 14, 2009 Share Posted April 14, 2009 you need to make this news script into a module then for it to work correctly with the rest of the website. Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-809475 Share on other sites More sharing options...
gizmola Posted April 14, 2009 Share Posted April 14, 2009 Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-809476 Share on other sites More sharing options...
Boxerman Posted April 14, 2009 Author Share Posted April 14, 2009 how do i make it a module??? and FACEPALM? Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-809484 Share on other sites More sharing options...
MasterACE14 Posted April 14, 2009 Share Posted April 14, 2009 look at one of the other module files, and try and copy that code layout, but replacing that modules code with your own. Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-809492 Share on other sites More sharing options...
Boxerman Posted April 14, 2009 Author Share Posted April 14, 2009 I have lots... still displays it... Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-809592 Share on other sites More sharing options...
gizmola Posted April 15, 2009 Share Posted April 15, 2009 Look Boxerman, You've managed somehow to get 100+ posts to this forum apparently without being even remotely aware of the rules of the board. One of those rules is that you should post to the right subforum (in this case your entire thread is about the customization of some 3rd party script, but you have yet to let anyone know what that script is). So not only are you not being forthcoming about your real question (in this case how to customize some unknown script package you didn't write, but you also posted this with a subject indicating it's about sql, which it isn't, in the wrong subforum. Then to top it all off, you don't provide any code. This whole thread is a waste of time. Quote Link to comment https://forums.phpfreaks.com/topic/153838-sql-s/#findComment-810342 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.