
hendrikbez
Members-
Posts
44 -
Joined
-
Last visited
Everything posted by hendrikbez
-
Date sorting not working in my html code
hendrikbez replied to hendrikbez's topic in PHP Coding Help
Good day Barand Thank you, I dis replace my code (my second part) wit the code you have giving me, But it is giving me the following error Fatal error: Uncaught Error: Call to a member function query() on null in C:\Mylinks\Kripto\Crypto\index.php:478 Stack trace: #0 {main} thrown in C:\Mylinks\Kripto\Crypto\index.php on line 478 <?php $res = $pdo->query("SELECT created_at FROM cmc_my_munte ORDER BY created_at DESC "); $today = new DateTime('now'); foreach ($res as $row) { $dt = new DateTime($row['created_at']); $diff = $dt->diff($today)->format("%y years -- %m months -- %d days"); echo "{$row['created_at']} | $diff <br>"; } ?> Will this work if I have three different tables, cmc(coinmarkcetcap), cgo(coingeko) and nmc (nomics) -
I am trying to sort my dates, but it shows it like this when I click the header. Does not matter what JavaScript I use, al of them that I tried, show it like the first part, Is there in my php code to get it to work. Need the last td to be ascending or descending 0 Jare -- 0 Maande -- 10 Dae 0 Jare -- 0 Maande -- 11 Dae 0 Jare -- 0 Maande -- 13 Dae 0 Jare -- 0 Maande -- 2 Dae 0 Jare -- 3 Maande -- 2 Dae 0 Jare -- 0 Maande -- 25 Dae 0 Jare -- 0 Maande -- 3 Dae instead of 0 Jare -- 0 Maande -- 2 Dae 0 Jare -- 0 Maande -- 3 Dae 0 Jare -- 0 Maande -- 10 Dae 0 Jare -- 0 Maande -- 11 Dae 0 Jare -- 0 Maande -- 13 Dae 0 Jare -- 0 Maande -- 25 Dae <td> <?php $date = $checkSqlRow["CREATED_AT"]; $newDate = date("Y M d", strtotime($date)); echo $newDate; ?> </td> <td> <?php $date1 = $date = $checkSqlRow["CREATED_AT"]; $date2 = date("y-m-d"); // this returns today's date $diff = abs(strtotime($date2) - strtotime($date1)); $years = floor($diff / (365 * 60 * 60 * 24)); $months = floor(($diff - $years * 365 * 60 * 60 * 24) / (30 * 60 * 60 * 24)); $days = floor(($diff - $years * 365 * 60 * 60 * 24 - $months * 30 * 60 * 60 * 24) / (60 * 60 * 24)); echo $years . " Jare -- \n"; echo $months . " Maande -- \n"; echo $days . " Dae\n"; ?> </td>
-
I have figure out what the problem was 1 / at the beginning was the problem
-
I am trying to show a image with a url link, the link is showing when you hover over it but the image is not showing. Getting image from my laptop. What am I doing wrong here? <?php $domains = [ "SHIBA INU" => "BINANCE%3ASHIBBUSD", "BABY DOGE BILLIONAIRE" => "HUOBI%3ABABYDOGEUSDT", "COIN 98" => "FTX%3AC98USD" ]; $chart = strtolower($checkSqlRow["CHART"]); echo "<td><a href='https://www.tradingview.com/chart/P2500000/?symbol={$domains[$checkSqlRow["CHART"]]} 'style='color:lime' target='_blank' ><img src=\assets\img\Table\chart1.png\" />$chart</a></td>"; ?>
-
Show more than one website with php echo
hendrikbez replied to hendrikbez's topic in PHP Coding Help
Now that I am awake (fully), I just changed something in the href, and it is working. -
I did get help from Barand (moderator) It is working, bur what happened if I have two different or more info after my html link In echo I can have last part as /Token or /address How can I get it to see anyone that must be used <?php $domains = [ "BSCSCAN" => "bscscan.com", "TRONSCAN" => "tronscan.org/#", "DGB" => "dgb.com", "HECOINFO" => "heco.com", "POLYGONSCAN" => "polyn.com", "RVN" => "rvn.com", "ETHERSCAN" => "etherscan.io/address", "THUNDERCORE" => "tttn.com", "SOLSCAN" => "solscan.com" ]; $address = strtolower($checkSqlRow["ADDRESS"]); echo "<td><a href='https://{$domains[$checkSqlRow["BLOCKCHAIN"]]}/token/$address 'style='color:lime' target='_blank' >$address</a></td>"; ?>
-
Thank you, I am new at learning PHP, I did pay a person to do this for me, and I am working from what he did, I already did make a lot of changes, but still have problems understanding this code. I see what you are saying here to me, If I start with <?php and end with ?> then I do not need to use in in between the code again. If it is so, then I have to go thru all the code and fix it. Ok, I have make a new column ["BLOCKCHAIN"] with all of the blockchains that can be used. I do not get it to work, see code below, something is wrong in the code I need to show the address in ["ADDRESS"] like (x0bfbgf66........), and when I click on it it must open the link. What is happening now, when running, it the <td> is removed and not showing in my table, it move for the row I changed one <td> back <td> <?php $checkSqlRow["ADDRESS"] = strtolower($checkSqlRow["ADDRESS"]); if ($checkSqlRow["BLOCKCHAIN"] == "bscscan") { echo '<a href="https://bscscan.com/token/', $checkSqlRow["ADDRESS"], '</a>'; } elseif ($checkSqlRow["BLOCKCHAIN"] == "tronscan") { echo '<a href="https://tronscan/token/', $checkSqlRow["ADDRESS"], '</a>'; } elseif ($checkSqlRow["BLOCKCHAIN"] == "dgb") { echo '<a href="https://dgb.com/token/', $checkSqlRow["ADDRESS"], '</a>'; } elseif ($checkSqlRow["BLOCKCHAIN"] == "hecoinfo") { echo '<a href="https://heco.com/token/', $checkSqlRow["ADDRESS"], '</a>'; } elseif ($checkSqlRow["BLOCKCHAIN"] == "polygonscan") { echo '<a href="https://polyn.com/token/', $checkSqlRow["ADDRESS"], '</a>'; } elseif ($checkSqlRow["BLOCKCHAIN"] == "rvn") { echo '<a href="https://rvn.com/token/', $checkSqlRow["ADDRESS"], '</a>'; } elseif ($checkSqlRow["BLOCKCHAIN"] == "etherscan") { echo '<a href="https://ethn.com/token/', $checkSqlRow["ADDRESS"], '</a>'; } elseif ($checkSqlRow["BLOCKCHAIN1"] == "thundercore") { echo '<a href="https://tttn.com/token/', $checkSqlRow["ADDRESS"], '</a>'; } elseif ($checkSqlRow["BLOCKCHAIN"] == "solscan") { echo '<a href="https:/solscan.com/token/', $checkSqlRow["ADDRESS"], '</a>'; } ?> </td>
-
Ok, thank you, will try to explain again. At the moment this code is working. <td> <a href="https://bscscan.com/token/<?php echo $checkSqlRow["ADDRESS"]; ?> "style="color:lime" target="_blank"> <?php echo $checkSqlRow["ADDRESS"]; ?> </a> </td> I I want to let it see different https addresses like tronscan ethscan eg. If I try the following code (I know it is wrong), then it needs to be added in ["ADDRESS"] eg bscscan or ethscan or anyone other tokenscan instead of [OXDweed5433......]that is in ["ADDRESS] . This is were I am stuck. on how to get it to work. <td><?php $checkSqlRow["ADDRESS"] = strtolower($checkSqlRow["ADDRESS"]); if ($checkSqlRow["ADDRESST"] == "bscscan") { echo '<a href="https://bscscan.com/token/<?php echo $checkSqlRow["ADDRESS"]; ?></a>'; } elseif ($checkSqlRow["WALLET"] == "altcoin trader") { echo '<a href="https://ethscan.com/token/<?php echo $checkSqlRow["ADDRESS"]; ?></a>'; } ?> </td>
-
I have the following code to show the token address in bscscan. I need it to be able to show ethscan website, pologon website eg. How can I let it get the correct one, when I add a token adress <td> <a href="https://bscscan.com/token/<?php echo $checkSqlRow["ADDRESS"]; ?>"> <?php echo $checkSqlRow["ADDRESS"]; ?> </a></td>
-
How to sum columns that is in SQL, to table that use php
hendrikbez replied to hendrikbez's topic in PHP Coding Help
Thank you, blind like a bat, did change all the $sum to $num, it is working, just do not show correct in html table (if I do 1.15 + 0.03 + 0.04 + 0.01 + 0.02 it should be 1.25 but it shows 1.2. -
I do not know how to do the following, need help with it Have a table in mysql with columns, but I need the following columns fees_1, fees_2, fees_3, fees_4 and fees_5, to be sum in my html table in only one column Fees_bnb. Using php and javascript. Any help on how to do this will be apricated Did try this, but it only sum up the first fees1 I have try this two code, but still not working 1. I do not know how to do the following, need help with it Have a table in mysql with columns, but I need the following columns fees_1, fees_2, fees_3, fees_4 and fees_5, to be sum in my html table in only one column Fees_bnb. Using php and javascript. Any help on how to do this will be apricated Did try this, but it only sum up the first fees1 <td> <?php $fees1 = $num1 = $checkSqlRow["FEES_1"]; $fees2 = $num2 = $checkSqlRow["FEES_2"]; $fees3 = $num3 = $checkSqlRow["FEES_3"]; $fees4 = $num4 = $checkSqlRow["FEES_4"]; $fees5 = $num5 = $checkSqlRow["FEES_5"]; $fees6 = $num1 + $sum2 + $sum3 + $sum4 + $sum5; echo $fees6; ?> </td> 2. <td> <?php $checkSql = mysqli_query("SELECT FEES_1, FEES_2, FEES_3, FEES_4, FEES_5, FEES_1 + FEES_2 + FEES_3 + FEES_4 + FEES_5 AS Total FROM nmc_my_munte"); $total = total; echo $total; ?> </td>
-
Good day. I am new to php, did learn quit a few things with php, but now I am stuck. (don't hurt the newbie) 1. in phpmysql I have a table with one of the columns (LIVE) in it that I want to show a live price in. At the moment I the column is set as varchar(30) do not know if this is correct. In my html table I want to add 3 or more if/else in, so when I update my html it must show 0.03234523 (depending on the price) I do not want all the rows to show this information I am getting the info from a js file, but cannot get it to work. (I did add the script in so it see my sss.js file. Here is the full script of javascript (it is at the moment just for one, will add the other two later when we can fix this), and the php script from my php file. What am I dong wrong and how can I fixed it. let ws_binance = new WebSocket('wss://stream.binance.com:9443/ws'); let html_element_binance = document.getElementById('show_price_binance'); let last_price_binance = null; ws_binance.onopen = function () { ws_binance.send(JSON.stringify ({ 'method': 'SUBSCRIBE', 'params': ['shibusdt@trade'], 'id': 1 })) }; ws_binance.onmessage = function (event) { let current_price_binance = JSON.parse(event.data); let price_binance = parseFloat(current_price_binance.p).toFixed(8); html_element_binance.innerText = price_binance; if ((price_binance < last_price_binance) && (isNaN(price_binance) == false)) { html_element_binance.innerText = '↓' + price_binance; html_element_binance.style.color = 'red'; } else if ((price_binance > last_price_binance) && (isNaN(price_binance) == false)) { html_element_binance.innerText = '↑' + price_binance; html_element_binance.style.color = 'lime'; } else if ((price_binance == last_price_binance) && (isNaN(price_binance) == false)) { html_element_binance.innerText = price_binance; html_element_binance.style.color = 'purple'; } last_price_binance = price_binance; }; <td> <?php $checkSqlRow["CCOINGECKO_LIVE"] = strtolower($checkSqlRow["COINGECKO_LIVE"]); if($checkSqlRow["COINGECKO_LIVE"] == 'trx') { echo "id='show_price_binance'"; } ?> </td>
-
How to show 1 of three pictures as image
hendrikbez replied to hendrikbez's topic in PHP Coding Help
Thank you, for information, it is working -
How to show 1 of three pictures as image
hendrikbez replied to hendrikbez's topic in PHP Coding Help
Yes thank you, did get this code from a professional php person ( he said he has written a lot for customers, and I have paid him for this work). Hope you feel better later on -
How to show 1 of three pictures as image
hendrikbez replied to hendrikbez's topic in PHP Coding Help
OK, will give the code, did not do changes yet as you said I must change. Let met try again to explain. See picture. I am now confused do I use php for it in the table (Legit) one. <table class="table-sortable mt32 customers-list" id="datatable"> <thead> <tr> <th height="50">Naam</th> <th height="50">Id</th> <th height="50">Bestaan Munt Nog</th> <th height="50">Rang</th> <th height="50">Skakel</th> <th height="50">Munt Skakel</th> <th height="50">Blokketting</th> <th height="50">Waar</th> <th height="50">Beursie Nommer</th> <th height="50">Beursie</th> <th height="50">Geverifieer</th> <th height="50">Prys</th> <th height="50">Dag</th> <th height="50">Week</th> <th height="50">Maand</th> <th height="50">Jaar</th> <th height="50">Munte</th> <th height="50">Usd</th> <th height="50">Zar</th> </tr> </thead> <tbody> <?php $total_multiply1 = 0; $total_multiply11 = 0; $total_multiply111 = 0; //Fetching CoinMarketCap table data if($fetchCoinMarketCapRowCount > 0){ foreach($decoded_json_coinMarketCap['data'] as $coinMarketCap) { // echo "<script>alert('HELLO');</script>"; $COINMARKETCAP_ID = $coinMarketCap['id']; $COINMARKETCAP_name = $coinMarketCap['name']; $COINMARKETCAP_symbol = $coinMarketCap['symbol']; $COINMARKETCAP_slug = $coinMarketCap['slug']; $COINMARKETCAP_name = htmlentities($COINMARKETCAP_name, ENT_QUOTES, "UTF-8"); $COINMARKETCAP_rank = $coinMarketCap['cmc_rank']; $COINMARKETCAP_price = $coinMarketCap['quote']['USD']['price']; $COINMARKETCAP_24h_change = $coinMarketCap['quote']['USD']['percent_change_24h']; $COINMARKETCAP_7d_change = $coinMarketCap['quote']['USD']['percent_change_7d']; $COINMARKETCAP_30d_change = $coinMarketCap['quote']['USD']['percent_change_30d']; $coinMarketCap24hColor = colorSet($COINMARKETCAP_24h_change); $coinMarketCap7dColor = colorSet($COINMARKETCAP_7d_change); $coinMarketCap30dColor = colorSet($COINMARKETCAP_30d_change); $checkSql = mysqli_query($conn,"SELECT * FROM coinmarketcap_coin_custom_info WHERE COIN_SYMBOL = '$COINMARKETCAP_symbol' ") or die(mysqli_error($conn)); $checkSqlRow = mysqli_fetch_array($checkSql); $checkSqlCount = mysqli_num_rows($checkSql); $COINMARKETCAP_price = sprintf('%.16f', floatval($COINMARKETCAP_price)); do{ $multiply111 = $COINMARKETCAP_price * $checkSqlRow["TOTAL_COIN"]; if($multiply111 != 0){ $multiply111 = sprintf('%.16f', floatval($multiply111)); } $total_multiply111 += $multiply111; ?> <tr> <td><font color="#EFE1CE"><b><label for="firstNum1"><?php echo $COINMARKETCAP_name; ?></label></b></FONT></td> <td style="color:#EFE1CE"><?php echo $COINMARKETCAP_symbol; ?></td> <td style="color:#EFE1CE"><?php echo $checkSqlRow["LEGIT"]; ?></td> <td style="color:#EFE1CE"><?php echo $COINMARKETCAP_rank; ?></td> <td> <a href="<?php echo $checkSqlRow["LINK"]; ?>" target="_blank"> <img src="<?php echo $decoded_json_coinMarketCap_logo["data"]["$COINMARKETCAP_symbol"]["logo"]; ?>" width="32px"></img> </a> </td> <td> <a href="<?php echo $checkSqlRow["SITE"]; ?>" target="_blank"> <img src="link.png" width="32px"></img> </a> </td> <td style="color:#EFE1CE"><?php echo $checkSqlRow["BLOCKCHAIN"]; ?></td> <td style="color:#EFE1CE"><?php echo $checkSqlRow["WHERE_NOW"]; ?></td> <td style="color:#EFE1CE"><?php echo $checkSqlRow["WALLET_NO"]; ?></td> <td style="color:#EFE1CE"><?php echo $checkSqlRow["WALLET"]; ?></td> <td style="color:#EFE1CE"><?php echo $checkSqlRow["VERIFIED"]; ?></td> <td id="firstNum2" style="color:#EFE1CE"><?php echo $COINMARKETCAP_price; ?></td> <td id="num1For24H" style="color:<?php echo $coinMarketCap24hColor; ?>"><?php echo round($COINMARKETCAP_24h_change,2); ?></td> <td id="num1For7D" style="color:<?php echo $coinMarketCap7dColor; ?>"><?php echo round($COINMARKETCAP_7d_change,2); ?></td> <td id="num1For30D" style="color:<?php echo $coinMarketCap30dColor; ?>"><?php echo round($COINMARKETCAP_30d_change,2); ?></td> <td id="num1For365D" style="color:white">NULL</td> <td id="secondNum2" style="color:#EFE1CE; font-weight:bold"><?php echo $checkSqlRow["TOTAL_COIN"]; ?></td> <td><input class="total-usd glow" type="text" id="<?php echo $COINMARKETCAP_symbol; ?>1" name="result5" value="<?php echo $multiply111; ?>" style="color:lime; background-color:black; font-weight:bold"/></td> <script type="text/javascript"> $(document).ready(function() { var COINMARKETCAP_symbol = '<?=$COINMARKETCAP_symbol?>'; var multiply111 = '<?=$multiply111?>'; var valueInZAR = $("#gcw_valFpWbgYyUL1").val(); var multiply222_total = multiply111 * valueInZAR; // alert(multiply22_total); if(multiply222_total!=0){ multiply222_total = multiply222_total.toFixed(10); } $("#"+COINMARKETCAP_symbol).val(multiply222_total); // alert(COINMARKETCAP_symbol); }); </script> <td><input class="total-usd glow" type="text" id="<?php echo $COINMARKETCAP_symbol; ?>" name="result6" style="color:lime; background-color:black; font-weight:bold"/></td> </tr> <?php -
How to show 1 of three pictures as image
hendrikbez replied to hendrikbez's topic in PHP Coding Help
Thank you I did not give my attempt, as I do not know on how to do the image (Have nor any idea on how to do it, as I am new to php, I did add a lot of new code to what I have received from a person . What i trying to get is, I have a html table, with more than 100 tokens in the table. 1 of my columns id for (legit), at the moment I type in "Yes" / "No" or "not at the moment"( easy to do for each one, when I add it in my admin file), bur I wnt to use 3 images on it (red/ green and yellow(this is where I do not know how to use it, how do add it in my admin file. So when I update any one of the tokens, I can use any on of the three images. -
I an new to this, still learning all the way. I have a table with more than 100 entries, each entry is different, but on one column I want to use 1 of three images to display in each entry. Want to do it in LEGIT, 3 images, red, yellow and green light to show This is my code, that I have, I do not know what more to give you PHP <?php if (isset($_GET['COIN_ID'])) { $COINGECKO_COIN_ID = $_GET['COIN_ID']; $sql = mysqli_query($conn,"SELECT * FROM coingecko_coin_custom_informaton WHERE COINGECKO_COIN_ID = '$COINGECKO_COIN_ID' "); $row = mysqli_fetch_array($sql); do{ $COINGECKO_COIN_ID = $row['COINGECKO_COIN_ID']; $COINGECKO_TOTAL_COIN = $row['COINGECKO_TOTAL_COIN']; $COINGECKO_LEGIT = $row['COINGECKO_LEGIT']; $COINGECKO_LINK = $row['COINGECKO_LINK']; }while($row = mysqli_fetch_array($sql)); } Here is my html <tr> <td><font color="#EFE1CE"><b><label for="firstNum1"><?php echo $coingecko_name; ?></label></b></FONT></td> <td style="color:#EFE1CE"><?php echo $COINGECKO_ID; ?></td> <td style="color:#EFE1CE"><?php echo $checkSqlRow["COINGECKO_LEGIT"]; ?></td> <td style="color:#EFE1CE"><?php echo $coingecko_rank; ?></td>