Jump to content

dropfaith

Members
  • Content Count

    1,141
  • Joined

  • Last visited

Community Reputation

0 Neutral

About dropfaith

  • Rank
    Prolific Member
  • Birthday 10/04/1980

Contact Methods

  • Website URL
    http://dropfaithproductions.com

Profile Information

  • Gender
    Male
  1. <?php /* Attempt MySQL server connection. Assuming you are running MySQL server with default setting (user 'roguebro' with no password) */ // Check connection if($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); } echo "<div class='innerleft'>"; // Attempt select query execution $id = $_GET['spotlight']; $sql = "SELECT * FROM champions WHERE id='$id'"; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){ $i = 0; while($row = mysqli_fetch_array($result)){ $i++; if ($i % 6 == 0) { }
  2. 456 stats data uhmm trying to word <li>Health: 17,180</li> <li>Attack: 1,193</li> <li>Max PI:</li> <li>Without Signature: 3,774</li> <li>With Signature (99): 4,812</li> 5 is diff stats 6 diff as well those arent currently used as i compile that data tho
  3. the link is doing what i want it to do but im using 2 queries to do it and it loses the image which i really want from champion table only other thing i can think of is do a double query and merge the image into the other which should work but i figured 1 total query was better
  4. http://roguebrother.x10host.com/spotlight.php?spotlight=49 Click Synergy on that in the content pane and it displays more context i pretty much need all the stuff so * seemed most efficient? CREATE TABLE IF NOT EXISTS `synergy` ( `idd` int(125) NOT NULL, `name` varchar(500) NOT NULL, `Champ` varchar(50) NOT NULL, `sid` int(124) NOT NULL AUTO_INCREMENT, `Synergy` varchar(6000) NOT NULL, PRIMARY KEY (`sid`) ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=23 ; CREATE TABLE IF NOT EXISTS `champions` ( `Name` text
  5. <?php // Check connection if($link === false){ die("ERROR: Could not connect. " . mysqli_connect_error()); } echo "<div class='innerleft'>"; // Attempt select query execution $id = $_GET['spotlight']; $sql = "SELECT champions.* , synergy.* ". "FROM champions, synergy ". "WHERE champions.id = $id AND synergy.idd = $id"; if($result = mysqli_query($link, $sql)){ if(mysqli_num_rows($result) > 0){ while($row = mysqli_fetch_array($result)){ echo "<span>" . $row['Name'] . ""; echo "</span>";
  6. so i know this is an easy one i just cant recall how or what to search to make it work been a bit since ive coded php right now it does everything needed but im trying to clean up the display a bit the echo line just loops the tr and tds endlessly to the left and right What im going for would be more like this Current Result <tr> <td>1</td> <td>2</td> <td>3</td> <td>4</td> <td>5</td> <td>6</td> <td>7</td> <td>8</td> </tr&
  7. that fixed that any way to reverse a foreach.. it displays from twitter so the loop is newest first and cycles thus replacing the newest of the tags otherwise i can just dump the foreach loop and have my bot look thru the script more often thus eliminating its need but adding server strain foreach ($user_timeline as $user_tweet) { if (isset($user_tweet->entities->media)) { $media_url = $user_tweet->entities->media[0]->media_url; $hashtag = preg_replace('^(ht|f)tp(s?)\:\/\/[0-9a-zA-Z]([-.\w]*[0-9a-zA-Z])*(:(0-9)*)*(\/?)([a-zA-Z0-9\-‌​\.\?\,\'\/\\\+&
  8. hrmm producing an error in this and i thought i had it ERROR: Could not able to execute (INSERT INTO hashtag (hashtag, link) VALUES ('arena ', 'http://pbs.twimg.com/media/C5QtXQEVUAAyk_-.jpg') ON DUPLICATE KEY UPDATE link='http://pbs.twimg.com/media/C5QtXQEVUAAyk_-.jpg'). You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'INSERT INTO hashtag (hashtag, link) VALUES ('arena ', 'http://pbs.twimg.com/med' at line 1 /* Attempt MySQL server connection. Assuming you are running MySQL server with default setti
  9. Sorry i did that on no sleep at 5 am basically right now it inserts a new row everytime the script runs which isnt ideal for the end game anymore i changed up my other side to fit it better theres 3 columns Id (auto inc) hashtags and link what i need is if hashtag exists edit link to the new link field there will never be more then 1 link in for each hashtag. i know it has something in here and an update instead of insert but im literally clueless on syntax for it function insertTweets($link,$hashtag){ $mysqli = new mysqli(DBHOST, DBUSERNAME, DBPASSWORD, DB
  10. Sorry this ends this script i got it doing everything i need except its making too many rows for what i need so i figure an update to it if the hashtag field is already in no idea how to do that i am teaching myself this as i go <?php // Require J7mbo's TwitterAPIExchange library (used to retrive the tweets) // You can get this library from here: https://github.com/J7mbo/twitter-api-php require_once('TwitterAPIExchange.php'); /** database cred **/ define('DBHOST','localhost'); define('DBUSERNAME',''); define('DBPASSWORD',''); define('DBNAME','roguewe
  11. if it helps it inserts a 1 to mysql
  12. so i have the array now but cant do anything database wise. i have 4 hashtag fields and a link one the system i need to use matches array(4) { [0]=> string(19) "#ContestOfChampions" [1]=> string(7) "#Cutoff" [2]=> string(9) "#Dormammu" [3]=> string(11) "#JaneFoster" } is a sample array i would love it if i could somehow insert each field into its own mysql column to make my next steps easier
  13. echo insertTweets($items['user']['name'],$items['user']['screen_name'],$items['text'],$items['created_at'],$items['id_str'],$items['user'] ['followers_count'],$hash); /** FInd hashtags build array **/ preg_match_all("/#(\\w+)/",$items['text'],$hashtags); //now $tags is an array of hashtags /** FInd hashtags build array **/ var_dump( $hashtags); } /** Insert to database **/ function insertTweets($name,$screen_name,$text,$created_at,$id_str,$followers_count,$hash){ $mysqli = new mysqli(DBHOST, DBUSERNAME, DBPASSWORD, DBNAME);
  14. So i got this pulling twitter data raw i cant for the life of me figure out how to explode items $text(tweet body and seperate the hashtags and enter them into a database (database hase 3 fields for hashtags) <?php /** database cred **/ define('DBHOST','localhost'); define('DBUSERNAME','***'); define('DBPASSWORD','**'); define('DBNAME','roguebro_tweet'); define('TWEETTABLE','twitter'); /** end database cred **/ /** Set access tokens here - see: https://dev.twitter.com/apps/ **/ require_once('TwitterAPIExchange.php');
  15. So i got the basis of this working here http://www.roguebrother.x10host.com/tweet.php what im trying to do is make it so it searches by not only username(complete) but also a certain hashtag (Duels) And get it to display any media (photos) in said tweet <?php require_once('TwitterAPIExchange.php'); /** Set access tokens here - see: https://dev.twitter.com/apps/ **/ $settings = array( 'oauth_access_token' => "831981818408677377-FexWOmvCyaZYWt3TYwmodmx3gMmFIqx", 'oauth_access_token_secret' => "L1vwbaBjsUivKn5NYVmGgve6V1lSP5THvjBk3LiadHyOj", 'consumer_key' => "t31OianjtopHhDEd
×
×
  • 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.