Foros del Web » Programando para Internet » PHP »

PHP conflicto con mysql y el host!!!

Estas en el tema de PHP conflicto con mysql y el host!!! en el foro de PHP en Foros del Web. Miren, estoy haciendo una web bastante compleja y necesito tener conexiones con la base de datos mysql (no lo hago con myqli ni con PDO ...
  #1 (permalink)  
Antiguo 01/12/2013, 01:44
 
Fecha de Ingreso: noviembre-2013
Mensajes: 10
Antigüedad: 10 años, 4 meses
Puntos: 0
PHP conflicto con mysql y el host!!!

Miren, estoy haciendo una web bastante compleja y necesito tener conexiones con la base de datos mysql (no lo hago con myqli ni con PDO porque mi host actual no lo soporta) aquí les dejo el código (la mayoría está hecho siguiendo el ejemplo de: http://www.youtube.com/watch?v=feKAJwhQFSk ). Aquí les dejo el index.php:

<?php
session_start();
include "config.php";
?>

<!DOCTYPE html>
<html>

<head>

<title>Spectrum-Solaris</title>

<style type="text/css">

#linkar {
background-color:#F4F4F3;

}

*{
padding:0px;
margin:0px;
}
}
.tema {
background-color: #000000;
}

.tematica {
background-color: #F4F4F3;
}


article,aside,details,figcaption,figure,footer,hea der,hgroup,nav,section,summary{display:block}audio ,canvas,video{display:inline-block}audio:not([controls]){display:none;height:0}[hidden],template{display:none}html{font-family:sans-serif;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}a{background:transparent }a:focus{outline:thin dotted}a:active,a:hover{outline:0}h1{font-size:2em;margin:.67em 0}abbr[title]{border-bottom:1px dotted}b,strong{font-weight:bold}dfn{font-style:italic}hr{-moz-box-sizing:content-box;box-sizing:content-box;height:0}mark{background:#ff0;color:#000}code, kbd,pre,samp{font-family:monospace,serif;font-size:1em}pre{white-space:pre-wrap}q{quotes:"\201C" "\201D" "\2018" "\2019"}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sup{top:-0.5em}sub{bottom:-0.25em}img{border:0}svg:not(:root){overflow:hidden }figure{margin:0}fieldset{border:1px solid #c0c0c0;margin:0 2px;padding:.35em .625em .btn-default[disabled],fieldset[disabled] .btn-default,.btn-default.disabled:hover,.btn-default[disabled]:hover,fieldset[disabled] .btn-default:hover,.btn-default.disabled:focus,.btn-default[disabled]:focus,fieldset[disabled] .btn-default:focus,.btn-default.disabled:active,.btn-default[disabled]:active,fieldset[disabled] .btn-default:active,.btn-default.disabled.active,.btn-default[disabled].active,fieldset[disabled] .btn-default.active{background-color:#fff;border-color:#ccc}.btn-primary{color:#fff;background-color:#428bca;border-color:#357ebd}tr.visible-sm.visible-lg{display:table-row!important}th.visible-sm.visible-lg,td.visible-sm.visible-lg{display:table-cell!important}}.visible-md,tr.visible-md,th.visible-md,td.visible-md{display:none!important}.label-info{border-radius:0}.label-warning{border-radius:0}.label-danger{border-radius:0}
</style>

</head>

<body>
<?php
$deutsch = 9834;

?>
<nav class='navbar'>
<div class='navbar-inner'>
<ul class='nav nav-tabs'>

<?php
if(isset($_SESSION['username']))
{
?>

<li><a href="index.php">Spectrum Questions</a></li>
<li><a href="ask.php">Ask</a></li>
<li><a href="username.php">Logged in as <?=$_SESSION['username']?></a></li>
<li><a href="logout.php">Log out</a></li>

<?php
}else{
?>

<li><a href="index.php">Spectrum Questions</a></li>
<li><a href="ask.php">Ask</a></li>
<li><a href="form.php">Sign Up</a></li>
<li><a href="login.php">Log In</a></li>

<?php
}
?>



</ul>
</div>
</nav>

<center><h1 id="dropdowns">Most Popular questions</h1><br/></center>
<div>

<div id="linkar">
<?php
mysql_select_db("spectrum-solaris",$conex);

$query = mysql_query("SELECT id,name,tittle,body,rango FROM articles ORDER BY id DESC",$conex);

$row = mysql_num_rows($query);

if($row > 0 ){

while($row = mysql_fetch_array($query)){

$rango = $row['rango'];
?>
<div class ="tematica" >
<?php
if($rango == 2)
{ ?>
<br/>
<small>Published by <b><a href="user.php?name=<?=$row['name']?>"><b><?php echo($row['name']); ?></b></a></b></small>
<br/>
<?php }else{ ?>
<small>Published by <b><u><b><?php echo($row['name']); ?></b></u></b></small>
<br/>
<?php } ?>

<?php
if($_SESSION['rango'] = $deutsch)
{
?>
<b><a href="borrar.php?id=<?=$row['id']?>"><font color="#FF0000">Borrar: </font></a></b>
<?php
}
?>

<big><a href="show.php?tittle=<?=$row['tittle']?>&rango=<?=$row['rango']?>&body=<?=$row['body']?>&name=<?=$row['name']?>"><b><?php echo($row['tittle']); ?></b></a></big>
<br/>
<hr class="tema">
</div>
<?php
}
}
mysql_free_result($query);
mysql_close($conex);
?>
</div>
<div>
</body>
</html>[/B]



no sé como lo podria arreglar. Además, cuando la pruebo en WAMP me sale que se puede pero en el servidor no...
(si queréis ver la página: https://www.spectrum-solaris.meximas.com)





PD: uso metro-bootstrap, no se si eso puede afectar.

Etiquetas: bucles, mysql
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 15:30.