Member Avatar

Hi all, I have been confusing myself for days over this so bear with me if it gets a bit confusing. I have a table called tags with columns id, name which list all unique tags (linux, php, mysql, etc.). And I have an array that includes some tags that have been entered: $tags = array('linux,php,mysql'); Now when the array has just one tag I can search the tags table and return whether the tag already exists in the table or not. But I am unsure how I can go about checking for each array item. My thinking on how …

Member Avatar
0
20
Member Avatar

$stmt = $dbconn->prepare("SELECT * FROM `members` WHERE username=? AND password=?"); $stmt->bind_param("ss", $username, $password); Is what I have. Database is connected etc. How can I set variable called `$dbresult` with array of SQL result? I don't want to set individual variables. I really need an entire array as answer. There's couple answers but some of them are outdated ("such function doesn't exist in this namespace") and others involve 10+ lines of code-functions that should actually be shorter. What is a clean and finite way to extract entire array out of prepared statement?

Member Avatar
0
1,429
Member Avatar

This question specifically relates to PHP's Memcached library when specifying a server key and adding multiple keys at once. **Question one**: Is it true that PHP's setMultiByKey() doesn't take advantage of the memcached server's native support for setting multiple keys at once, but that the logic is on PHP's side as a simple for loop, setting keys individually? **Question two**: Strictly from a performance perspective, in a case when one could expect the keys to already exist on the server more than 90% of the time, which of the following is more efficient? // Option 1: Setting everything and letting …

0
94
Member Avatar

please if anyone could tell me, how it would be possible, i want to save the content of a uploaded word document in database field with php, no problem with encrypted file like ( ´V z2Ö<Ö<ôÿÿÿÿÿÿ·üü?????ÿÿÿÿSSS8‹DÏLS¥9à1) as it shows if you open a word document in a browser. just want to save content of whole document in field. thanks for help in advance. i read it somewhere open file with fopen save it in variable n then save it in database, is it possible in that way ?

Member Avatar
0
2,444
Member Avatar

hi all iam working as software developer i wish to create my blog website using asp.net and C# so any one have idea so please help me in this Please thak you in advance

Member Avatar
0
1,538
Member Avatar

Greetings to everyone, I am working as a freelance web developer, i have more than 4 years experience in osclass scripts. I am working in the osclass scripts for the past 4 years and have created nearly 67 sites in osclass, and have created many plugins, cuztomized themes, plugin cuztomizations according to the clients need. I saw many of the post was unanswered here regarding the osclass scripts, so i make this new topic those who are wandering for a good programmer for their osclass script, reply me here if you need my support, thanks.

Member Avatar
1
255
Member Avatar

I am a nyophyte to PHP, and I've seen this answered so many different ways that it is confusing. I have a combobox that is dynamically populated from a MySQL table ACTIVE in a database AIRCRAFT. Based on the selected AIRCRAFTREGISTRATION value from the combobox, I want to find and display the value from a column in the same table labeled USEABLESEATS for the record with that AIRCRAFTREGISTRATION. Here is the code combobox: <select name="AssignAircraft" size="1" id="AssignAircraft" style="position:absolute;" <?php $mysqli = NEW MySQLi('hostname','User','Password','AIRCRAFT'); $resultSet = $mysqli->query("SELECT AIRCRAFTREGISTRATION FROM ACTIVE"); ?> <SELECT NAME="ACTIVE"> <?php while($rows = $resultSet->fetch_assoc()) { $acreg = $rows['AIRCRAFTREGISTRATION']; …

Member Avatar
0
208
Member Avatar

Hi all I'm trying to put together a room hire site, to be used by the lettings clerks, for our local Quaker meeting house and I've hit a couple of problems. I have an HTML form that, using data from a MySQL database and some JSON and JavaScript, when a certain checkboxes are checked inserts the hourly rate and, if required, the deposit payable on the room chosen. This works fine. However, the value that is displayed isn't being picked up and inserted into the database table. The code for retrieving the data is: $roomRateSQL = "SELECT * FROM tblRoomRates"; …

Member Avatar
0
80
Member Avatar
Reusable Code Snippet Decimal to Binary Converter

As usual i searched google to convert Decimal numbers to their Binary equivalents but i couldnt find any short algorithm for that matter. So here is mine..

Member Avatar
1
2,324
Member Avatar

## Basic workflow of my page ## [Image of Payment page](https://1drv.ms/u/s!Ava3iL9se3C3gTF_XJ_RiBBsWDHs) I have a payment page that has a name textbox (txtName), a PIN textbox (txtPin) and two textboxes (txtPaymentDate and txtPaymentTime) containing payment date and time respectively. The page also has a payment button (btnPay). txtName has a RequiredFieldValidator that checks if the field is blank. txtPin has a CustomValidator that checks if the field has a six-digit numeric value. A third CustomValidator makes sure that either both txtPaymentDate and txtPaymentTime are clear, or both of them are selected at the same time. Just one of them can't be …

Member Avatar
1
77
Member Avatar

Hello Friends, Recently I have created a website. And whenever I am visiting [my website](https://www.tblog.net/) one yellow i can see left side of address bar. It saying my connection not secure. "Part of this page are not secure(such as images)" . I don't know why it's showing like this.

Member Avatar
1
197
Member Avatar

## I am deleting item from cart through Jquery ajax,but it is not removing. It is returning "System.String[]". ## [WebMethod(EnableSession = true)] public string ClearItem(string Img) { try { if (Session["Items"] != null) { string[] session_item_arr = Session["Items"].ToString().Split('|'); for (int i = 0; i < session_item_arr.Length; i++) { string[] key_arr = session_item_arr[i].Split(','); foreach (string item in key_arr) { if (item == Img) { session_item_arr = session_item_arr.Where(val => val != session_item_arr[i]).ToArray(); } } bool item_inedx = Array.Exists(session_item_arr, x => x == session_item_arr[i]); if (item_inedx) { Session["Items"] = session_item_arr[i]; } else { Session["Items"] = session_item_arr; } } } } catch (Exception ex) …

Member Avatar
1
37
Member Avatar

Hello guys, I am using a Bootstrap grid with 6 element (As articles). 5 come directly from the database, and I need to add one more article element at the beginning, just for aesthetics. This is what I have so far. Any help is welcome. Thank you! Here's the idea of what i need https://imgur.com/a/JTlROZ2 <?php $i = 0 ?> <?php START LOOP ?> <?php if($i % 2 == 0): ?> <div class="ps-box"><!-- POST --> <div class="row"><!-- ROW --> <?php endif; ?> <article> Element </article> <?php if($i % 2 != 0): ?> </div><!-- / ROW --> </div><!-- / POST --> …

Member Avatar
0
91
Member Avatar

In terms of performance, which is the best jQuery CDN to use? The one at cdnjs.cloudflare.com, googleapis.com, jsDelivr, code.jquery.com, etc?

Member Avatar
0
344
Member Avatar

Hey guys, I have the following code... And what I want it to do but cant get it to do is add up all the price fields and change the sum every time a number is changed or a new line is added... but its not working? Can anyone see my problem? And can help me fix this? <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <script type="text/javascript" src="./jquery-1.7.min.js"></script> <script type="text/javascript"> function calculateSum() { var sum = 0; $("#price").each(function() { //add only if the value is number if(!isNaN(this.value) && this.value.length!=0) { sum …

Member Avatar
0
3,787
Member Avatar

Do you still use reCAPTCHA or something homemade? For us, we use jQuery to inject a hidden form field upon form submission that sends a little time sensitive and cookie sensitive string that we validate on the server side. I’m always curious to know what everyone else is doing.

Member Avatar
2
242
Member Avatar
Reusable Code Snippet PHP Configuration file class.

Hello! I needed a configuration file for a application I'm working on so I first used the built in ini functions in php but it wasn't easy to write the ini files. So I wrote myself a class here to parse a configuration file and write/edit configuration files. I plan to write some other useful functions for it eventually but it's quite simple really so I thought I would share it. Hope it helps! Ok here is the class: class config { //this function parses a config file public function parse_config($file){ //fetch the contents of the specified file. $content = …

Member Avatar
2
686
Member Avatar

I have spent a lot of time on this question, namely, how to programatically use a PHP script to send a PDF document to the printer without launching the Adobe print dialog that results from using arcord32.exe (the adobe reader). PHP has some useful classes for creating PDF's, i.e., the FPDF library, but printing the created file is a bear. For Windows XP and Windows 7 servers, the one open -source solution which works is to use the PDFBOX java library. Here are the steps. 1) Download the latest java pdfbox binary: http://www.apache.org/dyn/closer.cgi/pdfbox/1.7.1/pdfbox-app-1.7.1.jar and put it in a directory. I …

Member Avatar
7
12,580
Member Avatar

Hello, Any ever build web using AMP? What is it really? Is it similar like bootstrap? How to do it? Is it difficult or taking a long time to implement? Thanks in advance.

Member Avatar
1
797
Member Avatar

I created custom post type with custom taxonomy. Its working, but i am facing one issue is http://example.com/taxonomy-slug/%term%/post-title this is my custom post type url exg: http://example.com/products/cars/bmw-z4 Here products -> taxonomy-slug cars -> taxonomy-term bmw-z4 -> product title custom-post-type slug -> products/%custom_taxonomy% this link is working, but also its working when i change taxonomy term value Exg: http://example.com/products/crs/bmw-z4 This link also working even after changing(cars -> crs)/puting any value at that position. Actually it should be redirect to page not found page.

Member Avatar
0
112
Member Avatar

I want to be able to update my database in order to change some dynamic content on my site which contains movie reviews. First Step I need to be able to select which movie review I want to update by selecting it from a dropdown menu which is dynamically populated by the database. The second step is to populate a set of forms which related to the movie that was selected from the dropdown box so the information can be edited. The third step is to then run an update query to alter the databse. This is the code I …

Member Avatar
1
2,740
Member Avatar

I'm using the following code to verify that an email address has a valid DNS (otherwise, we consider the email invalid). $domain = substr($email, strrpos($email, '@') + 1); $isValid = checkdnsrr($domain, 'MX') || checkdnsrr($domain, 'A'); However, today it just flagged nearly all @gmail.com and @yahoo.com emails as invalid. Obviously the domains gmail.com and yahoo.com are valid. Why are there so many false positives for invalid email? What can I be doing instead that would be more accurate?

Member Avatar
0
746
Member Avatar

I have a table in and MSSQL DB that list period and week start dates for any date in a financial year but the page is only display the week numbers and period number none of the dates does any body have any ideas please. <?php $serverName = 'DESKTOP-R7RU80H\SQLEXPRESS'; $connectionInfo=array('Database'=>'WebPortal', 'UID'=>'WebAdmin', 'PWD'=>'P455w0rd'); $conn = sqlsrv_connect($serverName, $connectionInfo); if ($conn ) { /* echo "Connection established."; */ }else{ echo "Connection could not be established."; die( print_r( sqlsrv_errors(), true)); } echo $Today = date("Y-m-d"); echo "</br> </br>"; $sql = "SELECT * FROM Calendar_Data WHERE Date = '$Today'"; $result = sqlsrv_query($conn, $sql); while($rowvar = …

Member Avatar
0
383
Member Avatar

I have 5 items listed within a 200x200 box, and would like for the details of the clicked item to appear as either an overlay that spans only that box or as a div that completely replaces the original 5 options. Kinda like an accordion menu, but with the nav menu items completely disappearing rather than just moving out of the way. To return to the original layout, I'd like a simple [x] as the close button. I've searched everywhere for a tutorial, so I'm guessing maybe it's either not possible or a really bad idea. If the latter, let …

Member Avatar
0
414
Member Avatar

Hello, Sorry,This may be a silly question : How to assign ajax return value to javascript array? for example what I want is, I have declared an array in javascript as `all_skills = new Array();` and after that called ajax call in which I want to save the return value of ajax (on success) to this declred array. $.ajax({ url:'index.php?r=Skill_form/FetchAllSkills', type:'POST', data:name={}, success:function(data){ alert(data); } }); How to do this? alert(data) gives me result as : ["test db skill 3","vv"] i want to assign this array to all_skills

Member Avatar
0
7,252
Member Avatar

I want to order a website for my online shop, but I have a question: who is better to hire, a freelancer or a company? I can't make the site I want alone because I don't have much experience in creating sites. I think hiring companies is expensive. I don't even know if it makes sense to overpay. I don't need a fancy website. Simple, but beautiful site which will be information about my business. So what do you recommend?

Member Avatar
5
926
Member Avatar

Hi, its me again. I've seen the other code for looping textbox but it goesn't seem to apply in our script. What we need is a specific text box that loops when the user inputs a certain number of textboxes that he want to put. Example: there's a text box in which the user will enter the number of textboxes that he wanted to display, say 3. So after I click the submit button, there should be 3 textboxes as the output.

Member Avatar
-1
1,948
Member Avatar

I'm creating a report page and can't figure out how to convert the array (row) to just get the ip_address. I'm a newbie to php and can't figure out how to accomplish this. Here's the code that I have so far: <?php $filename = NULL; session_start(); // start of script every time. // setup a path for all of your canned php scripts $php_scripts = '../php/'; // a folder above the web accessible tree // load the pdo connection module require $php_scripts . 'PDO_Connection_Select.php'; if (!$con = PDOConnect("test")): { echo "Failed to connect to database" ; exit; } else: { …

Member Avatar
0
419
Member Avatar

How can I use jQuery's [.stop()](https://api.jquery.com/stop/) to stop *all* animations and not just for one specific selector. In my use case, I don't know the element being animated. Does this function bubble? Can I do something like `$(document).stop(true, false);` ??

Member Avatar
0
454
Member Avatar

Hi everybody. I'm trying to print all sub-category items using my own defined PHP function. The purpose of this function is to print all items, which parent value is $parent. There is some thing wrong with this function why it doesn't show information as I wish. To make you understand my aim, suppose that we've items categorized in different groups each has own groups ID. Calling this function I wish to get the all items of same group by feeding of group Id as argument ($parent). Could someone help me to find out the reason why this function doesn’t work, …

Member Avatar
0
432

The End.