Jump to content

OsirisElKeleni

Members
  • Posts

    29
  • Joined

  • Last visited

About OsirisElKeleni

  • Birthday 10/30/1994

Profile Information

  • Gender
    Male

OsirisElKeleni's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. Thank you all for you're replies! I have been stupid and forgot thet HTML doen't belong in the php tags.. And indeed the else function is nothing without an if
  2. I dont see where I'm missing the closing tag i'm sorry, The php.ini file i've uploaded and this is the error: Parse error: syntax error, unexpected '$row' (T_VARIABLE), expecting ',' or ';' in /home/osiris1q/public_html/includes/header.php on line 20 This is the line but i dont see whats wrong: echo "<li><a href='#'></a>"$row"</li>";
  3. Hello again! I'm here with another PHP/Mysqli related question, I want to output the data i receive from the Query: SHOW tables; Into html code, more specific: links. This is what i try'd to do: <div class="container"> <div class="header" align="center"> <nav> <ul> <li><a href="#">Home</a></li> <li><a href="#">Databases</a> <ul> <?php $mysqli = new mysqli('localhost','*****','*****','*****'); if ($mysqli->connect_error) { die("Connection failed: " . $mysqli->connect_error); } $sql = 'show tables from osiris1q_mtg'; $result = $mysqli->query($sql); if(!$result = $mysqli->query($sql)){ die('There was an error running the query [' . $mysqli->error . ']'); } // output data of each row while($row = $result->fetch_assoc()){ echo "<li><a href='#'></a>"$row"</li>"; } } else { echo "<li><a href='#'></a>0 results</li>"; } </ul> </li> </ul> </nav> </div> <!-- end .header --> ?> This is the header.php file which is included in the actual index page. This doesn't return anything not even the html parts of it. Even all the files i have 'included' aren't showing up anymore. I hope i explained myself good enough for anyone to understand How Anyone can help me out! Thank you in Advance!
  4. Okido! I will try it and get back to you with results or errors i can't solve thanks a lot!
  5. alright i just thought that if i would get the data and close the connection the data would be lost. Thanks for the guiding guys!
  6. i can get acces to it the 2 domains. Then what what Alex and Barand suggested is the right thing right?
  7. Alright i think you're saying its possible to connect to 2 different servers in one script? I've looked up on this and i found this: <?php // we connect to example.com and port 3307 $link = mysql_connect('example.com:3307', 'mysql_user', 'mysql_password'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_close($link); // we connect to localhost at port 3307 $link = mysql_connect('127.0.0.1:3307', 'mysql_user', 'mysql_password'); if (!$link) { die('Could not connect: ' . mysql_error()); } echo 'Connected successfully'; mysql_close($link); ?> Do you know for sure its possible to connect to 2 different servers at once? If so i'd love to have a confirmation on that because it all seems not possible ;p
  8. Thanks for the quick response guys! However how will i do this? can i connect to another server in the same script? The second server is a mysql database as well if that is what you mean. If you could give me a little start to what functions i should use i can work my way from there i think. Thanks!
  9. Hello everybody! I'm here today with a mystery i can't solve... The problem i'm having is that i need to be able to transfer mysql data from one server to another one. Retrieving data from the one database is easy, but making it transfer to another server is not that easy for me. I have it printing out the data ATM This is how i retrieve data from one server: <?php $dbhost = ""; $dbname = "eg_xenforo"; $dbuser = ""; $dbpass = ""; $conn = mysqli_connect("$dbhost","$dbuser","$dbpass","$dbname") or die("Error " . mysqli_error($conn)); $sql= "SELECT username FROM xf_user WHERE FIND_IN_SET('9',secondary_group_ids) UNION SELECT username FROM xf_user WHERE FIND_IN_SET('10',secondary_group_ids) UNION SELECT username FROM xf_user WHERE FIND_IN_SET('12',secondary_group_ids)"; $result = mysqli_query($conn, $sql); if (mysqli_num_rows($result) > 0) { // output data of each row while($row = mysqli_fetch_assoc($result)) { $name = $row['username']; echo "$name <br>"; } } else { echo "0 results"; } ?> This is what i get as result: CosmonautBob ooglebrain JamieKG Quinnter16 Jordan Zoehamp skynet1123 misscupcake1306 Sir Crimson These are usernames that should be added onto another server in a database table. Any suggestions? Thanks in advance!
  10. Thanks that worked out great! I didnt know primary key could be added on multiple columns, now i know! Thanks alot!
  11. I tryd it but the sql didnt work I'm trying to check mutiple criteria in one row if its already in my database the newly sent record should not be added. I'm going to give you an example of what a record looks like: Name Color Type Sub-Type Power Toughness CMC Rarity Expansion Foil Stock Kite Shield Colorless Artifact Equipment 0 Uncommon M12 No 1 The top row are the names of the colums the bottom row is the data stored. The thing is another row could be exactly the same as the one above with the expansion changed or the Foil status changed or the name slightly changed. So i'd have to check atleast these 3 criteria in one row to know for sure its not in there already. I hope this explains alot more :/ I basicly need to be able to check for 3 different criteria in one row to be sure its not the same. If you look at the second and 3rd row on the webite you'll see that checking the name for differences is not enough because the Foil row is different. If you type in Loxodon Warhammer in the first input box and press enter you'll see that the Expansion and the Rarity is different. So i hope now you understand what i'm trying to achieve here. I hope you understand more now. This is my website: http://osiriselkeleni.be So you can see what setup i have atm. Thanks for helping me out!
  12. This is a dummy question but i cant get multiple criteria in the count function. This is what i'm trying to do: SELECT COUNT(Name, Expansion, Foil) AS NameCheck FROM Osiris WHERE Name="$name" Expansion="$expansion" Foil="$foil" I have Colums named: `Name` `Color` `Type` `Subtype` `Power` `Toughness` `Manacost` `Rarity` `Expansion` `Foil` `Stock` I want to check before i enter a new record if its not already there, by checking the Name, Expansion and Foil colum on the same record. I think i have just messed up that code line but i cant seem to find any solution on the web. Thanks in advance!
  13. This did do the trick! Thanks alot! I don't fully understand what all this does, so i rather not use it for now i could look into it but its working fine now, If you want to explain this piece of code i'd love to learn it but i dont really like to implement things in my web unless i understand it a bit and know how to mess around with it. Still you helped me and thanks for that!
×
×
  • 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.