Ver Mensaje Individual
  #1 (permalink)  
Antiguo 15/05/2015, 13:48
conielpana
 
Fecha de Ingreso: abril-2015
Mensajes: 4
Antigüedad: 8 años, 11 meses
Puntos: 0
ordenar base de datos de manera ascendente

hola a todos tengo una pagina web la cual le hago promocion via twitter

googleando por alli consegui la manera de hacerlo y me funciona pero no de la manera que yo espero

la cuestion es simple funciona de la siguiente manera

creas una base de datos alli introduces los twetts que deseas publicar y el codigo en php te los va publicando

pero hay un problema que siempre me envia practicamente los mismos tweets o tiene preferencia por algunos no mencionando otros que son tambien de importancia

en mi base de datos tengo 35 twetts me gustaria que los fuera publicando de uno en uno de manera ascendente osea empiece por el 1 luego el 2 despues el 3 mas adelante el 4 mas tarde el 5 y asi hasta llegar al 35 y se devuelva de nuevo al 1 y siga su ciclo de nuevo pero no consigo como hacerlo


ACA PEGO EL CODIGO ORIGINAL

Código:
<?php
//www.webinfopedia.com
//http://www.webinfopedia.com/auto-tweet-with-oauth-in-php.html esta es la pagina de donde saque la informacion pero en estos instante no funciona la pagina


$consumerKey    = 'mi consumer key';
$consumerSecret = ' mi consumer secret';
$oAuthToken     = 'mi oAuthToken';
$oAuthSecret    = 'mi oAuthSecret';

require_once('twitteroauth.php'); // este es un archivo que me descargue 

$tweet = new TwitterOAuth($consumerKey, $consumerSecret, $oAuthToken, $oAuthSecret);

require_once("db.php"); // este es mi archivo de conexion

$sql=mysql_query("select title from tweets order by rand()");
$showfetch=mysql_fetch_array($sql);
$tweet->post('statuses/update', array('status' => $showfetch['title'] ));

?>
ESTE ES OTRO EDITADO PERO ME DA LOS MISMOS ERRORES TWITTEA PERO DE MANERA ALEATORIA Y CON PREFERENCIA A CIERTOS TWEETS

Código:
<?php
//www.webinfopedia.com
//http://www.webinfopedia.com/auto-tweet-with-oauth-in-php.html


$consumerKey    = 'mi consumerkey';
$consumerSecret = 'mi consumersecret';
$oAuthToken     = 'mi oAuthToken';
$oAuthSecret    = 'mi oAuthSecret';

require_once('twitteroauth.php');

$tweet = new TwitterOAuth($consumerKey, $consumerSecret, $oAuthToken, $oAuthSecret);

require_once("db.php");
$i=0;
$sql=mysql_query("SELECT title FROM tweets ORDER BY id ASC");
while($row = mysql_fetch_array($sql)){
	$showfetch[$i++]['title']=$row;
}
shuffle($showfetch);
$tweet->post('statuses/update', array('status' => $showfetch[0]['title'] ));

?>

sinceramente ya no se que mas hacer