Jump to content

TheStudent2023

Members
  • Posts

    136
  • Joined

  • Last visited

Everything posted by TheStudent2023

  1. Web Gurus, Here are the codes I drew-up many months ago. Glancing over them, can you spot any that is unnecessarily going through the IF condition ? (Is pointless). If so, then which one and why it is pointless over there ? Do not worry, on my website I will not use 'root' as user. 1. mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $conn = mysqli_connect("localhost","root","","buzz"); //mysqli_connect("server","user","password","db"); $input_1 = 'magi'; //username. $input_2 = '[email protected]'; //email. $input_3 = '0'; //id. $sql = "UPDATE users SET username=?,email=? WHERE id=?"; $stmt = mysqli_prepare($conn,$sql); mysqli_stmt_bind_param($stmt,"sss",$input_1,$input_2,$input_3); mysqli_stmt_execute($stmt); echo 'UPDATED SUCESSFULLY: ' .mysqli_stmt_affected_rows($stmt); mysqli_stmt_close($stmt); mysqli_close($conn); 2. mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $conn = mysqli_connect("localhost","root","","buzz"); //mysqli_connect("server","user","password","db"); $input_1 = 'magi'; //username. $input_2 = '[email protected]'; //email. $input_3 = '0'; //id. $sql = "UPDATE users SET username=?,email=? WHERE id=?"; if($stmt = mysqli_prepare($conn,$sql)) { mysqli_stmt_bind_param($stmt,"sss",$input_1,$input_2,$input_3); mysqli_stmt_execute($stmt); echo 'UPDATED SUCESSFULLY: ' .mysqli_stmt_affected_rows($stmt); } else { echo 'Mysqli Error: ' .mysqli_error(); echo '<br>'; echo 'Mysqli Error No: ' .mysqli_errno(); } mysqli_stmt_close($stmt); mysqli_close($conn); 3. mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $conn = mysqli_connect("localhost","root","","buzz"); //mysqli_connect("server","user","password","db"); $input_1 = 'magi'; //username. $input_2 = '[email protected]'; //email. $input_3 = '0'; //id. $sql = "UPDATE users SET username=?,email=? WHERE id=?"; if($stmt = mysqli_prepare($conn,$sql)) { mysqli_stmt_bind_param($stmt,"sss",$input_1,$input_2,$input_3); if(mysqli_stmt_execute($stmt)) { echo 'UPDATED SUCESSFULLY: ' .mysqli_stmt_affected_rows($stmt); } else { echo 'Mysqli Error: ' .mysqli_error(); echo '<br>'; echo 'Mysqli Error No: ' .mysqli_errno(); echo '<br>'; die('Failed to INSERT!'); } } else { echo 'Mysqli Error: ' .mysqli_error(); echo '<br>'; echo 'Mysqli Error No: ' .mysqli_errno(); } mysqli_stmt_close($stmt); mysqli_close($conn); 4. mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $conn = mysqli_connect("localhost","root","","buzz"); //mysqli_connect("server","user","password","db"); $input_1 = 'magi'; //username. $input_2 = '[email protected]'; //email. $input_3 = '0'; //id. $sql = "UPDATE users SET username=?,email=? WHERE id=?"; if($stmt = mysqli_prepare($conn,$sql)) { mysqli_stmt_bind_param($stmt,"sss",$input_1,$input_2,$input_3); mysqli_stmt_execute($stmt); if(mysqli_stmt_affected_rows($stmt)) { echo 'UPDATED SUCESSFULLY: ' .mysqli_stmt_affected_rows($stmt); } else { echo 'Mysqli Error: ' .mysqli_error(); echo '<br>'; echo 'Mysqli Error No: ' .mysqli_errno(); echo '<br>'; die('Failed to INSERT!'); } } else { echo 'Mysqli Error: ' .mysqli_error(); echo '<br>'; echo 'Mysqli Error No: ' .mysqli_errno(); } mysqli_stmt_close($stmt); mysqli_close($conn); I know you do not like this part on any of the above on their ELSEs: echo 'Mysqli Error: ' .mysqli_error(); echo '<br>'; echo 'Mysqli Error No: ' .mysqli_errno(); Bear in mind, these samples are DEV mode. I prefer you show me in shortest & minimalist way to write EXCEPTION handling stuff that everyone keeps talking about. Tutorials explain something but leave out explaining other necessary things and confuse me. Let us see how well simplified you can teach. Thanks!
  2. Programmers, Sql and Php Prepared Statements. How do you yourself would check whether the SQL managed to update a row or not if you were using mysqli and prepared statements ? 1). mysqli_stmt_execute() 2). mysqli_stmt_affected_rows() On which one of the above lines would you add the IF condition to ?
  3. Manual is too complicated. So trying this website instead: https://www.w3schools.com/php/func_array_filter.asp But it does not explain what a callback is. what is it ? Can you show me an example ? And, I do not understand this code atall because the $var has not been defined: <?php function test_odd($var) { return($var & 1); } $a1=array(1,3,2,3,4); print_r(array_filter($a1,"test_odd")); ?> What is the value of $var ?
  4. Programmers, On your websites do you accept paypal payments or something else ? I do not like paypal. Thinking of adding BitCoin instead. Do you know of any BitCoin wallet/service where the transactions are free ? I do not like the middleman services as they hold onto your BitCoins in their servers and if they get hacked then you have lost all your BitCoins. Plus, they charge you extra fees than the usual blockchain fee.
  5. @kicken Mmm. Then in that case ChatGpt will be useful to my php projects. Good. So ChatGpt showed you a code sample as a solution, did it ? Why do not you try to get it to fix the problem with the solution instead and get it to highlight where it fixed to what and see if it understands what you ordering it or not ? That way, you get it to do the dog work.
  6. @requinix Any vps host suggestions based on my conditions ?
  7. @mac_gyver Sorry, I got your username wrong when tagging you in my reply above.
  8. Sorry. Did not really understand the structure or the code that much. This is adv stuff. Right ? Not intermediate, let alone beginner level. Yes ?
  9. From the looks of this example, it seems you added characteristics to a variable and then added restrictions or standard to be met if the variable name needs to be changed. So, what has objects got to do with any of this ? And characteristics is called "class" ?
  10. @requinix I reckon you regularly use these AIs for online business. Care to share your stories, both successful ones & unsuccessful ones ? Do not mind me nosying in like this. I might aswell replicate your steps and learn a few things in the process. Out of all the Mods, I reckon you have better business sense, be they offline or online businesses.
  11. @mac_gyver Just curious, will you ever try building such an AI ? I would love to see how your one works. You are a very good programmer and know your stuff. It should be overwelmingly tempting for you to make an attempt, unless you know it is foolish and fruitless. Know something I do not know.
  12. @kicken Which ones you use yourself and why you use them ?
  13. @requinix What does your Smiley mean ? Anyways, bing.com uses ChatGpt, based on the youtuibe vid lastnight that I watched. Leaving aside ChatGPT or AI stuff, what do you miss in a searchengine ? And, you reckon ChatGpt will kill the searechengines ?
  14. @macguyver Doing a combing operation on your feed-back .... >>switching to the much simpler and more modern PDO database extension will eliminate about half of the database statements. this alone will answer your database questions since the PDO extension was designed to be simple and usable.<< Sorry. I am nearly in my late 40's. You know at this age, nothing sinks into the memory. More like you forget things at this age. Took me nearly 6yrs to go past beginner level in php. Struggling at intermediate level as learning from home all by myself. Took me that long to learn to build membership site with mysqli & prepared statements in procedural style. It will probably take another 6yrs to learn oop & pdo. And so, not bothering with pdo anymore. After I finish my project to build membership site (reg, login, logout, acc homepage, site search page) and searchengine (index, crawler), I am jumping into the more simpler python language. Php is too complicated. And so, I appreciate all your upcoming reviews, feedbacks, advices, tips, etc. of my codes on mysqli & prepared statements ONLY. I got no programming background. Self learning php. Php is my first language. I hope you understand. Struggling with php as it is. It's amazing, I got this far daring to build my own membership site, searchengine with beginner level (mysqli & procedural style) programming at this age. Gonna be a pensioner in one & half a dacade, if I live. >>1. put the php error settings in the php.ini on your system, so that you can set/change them at a single point.<< I use localhost Wampp. Before Xampp. Do not know how to fiddle with .ini file. I just add the error reporting to another file and call it on the main file. I added the error reporting code on my op so you do not repeat yourself advising me to add it. Show me how you write your error reporting codes, if mine not perfect. I am not good in following instructions without seeing code examples. Seeing code examples, gets imprinted in my mind and I tend to remember things. Else, I will make the same mistakes again and again on my upcoming codes and threads and you will waste your breath repeating the same thing over & over. So, best you just type your error reporting codes here for me to memorise as I write codes from memory on all my projects after learning the codes. I do not copy-paste codes to my projects. So, for me to memorise the error reporting codes, do write them and show me how I should have written them. Here is my faulty code again: //Report Error. ini_set('display_errors',1); ini_set('display_startup_errors',1); error_reporting(E_ALL); >>2. you cannot set display_startup_errors in your code because php has already started when your code is being executed.<< Ha ? I do not follow you! How come no other programmer picked-up on this mistake ? Infact, they told me to write those particular codes: //Report Error. ini_set('display_errors',1); ini_set('display_startup_errors',1); error_reporting(E_ALL); Again, do write me your code so it sinks into my understanding what you really mean. And, when and where shall I write this following code bit then ? ini_set('display_startup_errors',1); EDIT: Oh, I get it. That particular line is supposed to shoe me admin error when I startup the php interpreter on my webserver! Yes ? >>3. the code for any page should be laid out in this general order - 1) initialization, 2) post method form processing, 3) get method business logic - get/produce data needed to display the page, 4) html document.<< I did do it in this order. I just forgot the $var initilisation ($vars = NULL) bit and did not bother building the form in this TEMPLATE yet. Apart from that, I see my whole script in your general order. Is it not ? If not, do point out to me where not. I am slow to catch on, at this age. >>4. most of the php code needed for searching/pagination goes in the get method business logic section.<< >>5. post method forms are used when performing an action on the server, such as inserting, updating, deleting data, sending an email, writing/updating a field.<< >>6. get method forms/links are used when determining what will be displayed on a page, e.g. searching, pagination.<< I know. I built my registration.php & login.php with POST METHOD. Built pagination.php/search.php with GET Method originally few yrs back. Then last yr, attempted with POST method and got stuck and quit half-way. I think IO built another half with both POST & GET methods. I will show you them to you maybe in future when I look back into those projects. Ok ? I like to fiddle around. Experiment unorthodox ways. And so, doing it. >>7. the second entry in the $tbls array contains a $. did you actually use this array to validate the $tbl input?<< Already answered this in my previous reply to you. >>8. don't use the root database user in applications. create a specific database user, with a password, with only the necessary permissions for use in an application.<< Scratching my head! How did you know I was using the root here ? What is the big techno secret ? EDIT: Silly me! You spotted this: $conn = mysqli_connect("localhost","root","","buzz"); //mysqli_connect("server","user","password","db"); How will hacker know I used root and how will he benefit if I did and how will I benefit if I did not use the root user ? >>9. don't output raw database errors onto a wab page. this only helps hackers. instead, use exceptions for database statement errors (this is the default for both the mysqli and PDO extension in php8+) and in most cases simply let php catch and handle any database statement error, where php will use its error related settings to control what happens with the actual error information (database statement errors will 'automatically' get displayed/logged the same as php errors.) the exception to this rule is when inserting/updating duplicate or out of range user submitted data. in this case, your code would catch the exception, test if the error number is for something your code is designed to handle, and setup a unique and helpful error message for the user. for all other error numbers, just re-throw the exception and let php handle it. this will let you remove all the existing database error handling logic, simplifying the code. btw - mysqli_stmt_execut() can fail with an error but you don't have error handling logic for it, but since you will be removing all the existing error handling logic when using exceptions for database statement errors, you won't have to remove this non-existent code.<< Kindly, show me how to write this code on this particular TEMPLATE. Do write comments as I want to understand each line. Not interested in just copy-pasting & memorising codes I do not understand. >>10. if you are going to continue to use the mysqli extension, don't use mysqli_stmt_init() followed by mysqli_stmt_prepare(), just use mysqli_prepare().<< I thought I was using the new one. That other one is some wrapper of some sort or alias. Php interpreting the alias might slow down my page if millions of people are on my website. Right ? >>11. if you are going to continue to use the mysqli extension, use the OOP notation. it is both simpler and because the php error response is different between the procedural and OOP notation, things that are fatal problems will produce fatal php errors when using OOP, but only produce warnings when using procedural notation.<< You mean, procedural uses the circular vrackets and oop uses the ->. I got used to learning the former as initial tutorials taught me that format and I memorised it. Then, I came across the -> format and I tried learning it but the other format I learnt kept muddling me up and so I quit the new format. Even though new format is shorter. I thought that stuff -> was oop. But now I hear it's not oopand so that is probably what you mean by oop notation. You mean "oop like martker" ? Yes ? I tried learning pdo and oop. I just do not understand what an object is. read tutorials. No luck To me, an object is a physical item. And sop, do not understand all this object stuff in programming. Do not understand the difference between the procedural & oop. All I see is marker's different. On one you use () and on the other you use ->. That is all I understand. What has object or item or thing got to do with any of this programming, I do not understand. Beats me. Hence, I stick to mysqli and procedural style. Understand ? >>12. in most cases, you don't need to free prepared statements, result sets, or close database connections since php will destroy all resources created on a page when your script ends.<< So, why does the php manual and tutorials show to write all these lines of codes then ? or, they were necessary in previous versions ? In that case, they should have updated the manual. Because, originally I did not use them but few yrs later came across them and thought have to use them. I tell you what. You seem to know your stuffs. And not some any Tom, Dick & Harry, Larry and Mahony. So, I think it is best you weed-out the chaff from the wheat on my op code. That way, I can learn your format, the proper professional way and unlearn the chaffs I learnt from tutorials and the manual. That would be a very good idea! >>13. you should keep the input data as a set in a php array variable, then operate on elements in this array variable throughout the rest of the code, i.e. don't write out line after line of code that's basically copying each input to another variable.<< Sorry. I do not quite follow. Getting confused now. Can you grab snippets of my code and show me how to write what you saying to write. Then, I should be able to understand what you mean. Examples speak a million words. Guessing you mean not to do like this the long way: $col = $_GET[col]; echo $col; But do it short & direct: echo $_GET[col]; I used to originally write like that. But then saw others or some tutorials do it that other long way and so stuck to it. When I write TEMPLATES, on one I write the long way and on another I write the short way. I like doing things different ways and making many versions of the same script. It is my habit. Good or bad. If it is bad, then explain why. In the retail industry, they build model 1, then 2. But release model 2 not. Else, model 1 will not sell. So they release model 1 first and then model 2. Thus making same customer buy twice. I doing same. Release long version first. Then, the short version. Currently, not selling any versions of scripts. Planning on giving them away for free or build my website with long version first and sell it. And then build a 2nd website with short version. Customer cannot argue my new website got exactly same code. No copyright issue will be here. >>14. you should trim all input data before validating it. after you do the above item, you can accomplish this with one single line of php code.<< You mean do some thing like this: $input_2 = !EMPTY(trim($_GET['input_2']))?trim($_GET['input_2']):null; I used to do that. On this case, I forgot. I trim the $_POSTs. >>15. related to the above item, don't copy fetched data to other variables for nothing. just use the original variables that the data is in.<< I think you talking about this: while($row = mysqli_fetch_array($result,MYSQLI_ASSOC)) { $id = $row['id']; $domain = $row['domain']; $word = $row['word']; $phrase = $row['phrase']; echo "$id<br>"; echo "$domain<br>"; echo "$word<br>"; echo "$phrase<br>"; echo "<br>"; } To do it like this: while($row = mysqli_fetch_array($result,MYSQLI_ASSOC)) { echo $id = $row['id']; echo $domain = $row['domain']; echo $word = $row['word']; echo $phrase = $row['phrase']; } Well, tutorials showed me to do it like former. And I do make 2 versions on these, like I mentioned earlier. The former version and the latter. On my latest 4th PAGINATION version, lastnight I wrote like this: while($row = mysqli_fetch_array($result,MYSQLI_ASSOC)) { for($i=0;$i<$columns_count;$i++) { echo '<b>'.$headings[$i].': </b>'.$row[$columns[$i]]; echo '<br>'; } } But that is another story & project. That new project is about shortening the PAGINATION code as much as possible. PAGINATION version 4. I will open a thread about that on this forum. So, do lookout for it. >>16. you should store user/validation errors in an array, using the field/input name as the main array index.<< Yes.very little tutorials and a programmer or 2 showed me to do it like that. But I find it complicated and just go straight and direct rather than deal with arrays here as the php intepreter going inside arrays and grabbing the error data will slow down my page if millions of people are browsing the SERP at the same time. More cpu used. Remember, I am building a searchengine. >>17. after the end of all the validation logic, if there are no errors (the array holding the errors will be empty), use the submitted data.<< If you beg to differ what I claimed above then do remind me how to write these error arrays as I have forgotten it as I am not in the habit of writing errors in arrays. >>18. if there are errors, the code will continue on to display the html document, test and display any errors, re-display any form, populating the form field values with any existing data so that the user doesn't need to keep reentering/selecting data over and over.<< Thanks. I have done this before on my other projects. This is where when user makes input mistakes on signup form then input gets repopulated on the form after they get error from the reg page. But this code on this thread is a BAREBONE TEMPLATE. hence, I did not add all that luxury stuff. When I work on a project, I will just copy-paste these BAREBONE TEMPLATES onto my project file and then add the extra bits, like search filters and all the other luxury stuffs. Right now, I just showing you BAREBONE. On my other threads, I will show you the NON-TEMPLATES/NON-BARE BONES but my actual project codes for you to review. On them all these extra luxury bits will be present. Ok ? On my threads and on my codes, when it says TEMPLATE, then it is BARE MINIMUM BONE. Else, it is PROJECT FILE that will have all the luxury bits you expecting. Remember, what I said as my codes & threads will come in 2 flavours: TEMPLATE, PROJECT. I think you get the picture. >>19. any dynamic value you output in a html context needs to have htmlentities() applied to it to help prevent cross site scripting. Yeah, I know. Notice my PAGINATION section at the bottom. It took me mnths to learn all the htmlspecialchars(), htmlentities(), urlencode(), intval(), etc, stuffs (to build PAGINATION section at bottom of page) and they still confuse me now and then. And lo and behold! I came across http_nuild_query() and got pissed off why php INC does not weed-out old stuffs! You understand why it taking me 6yrs at beginner level ? I first learnt mysql little bit. The come across mysqli_. Then have to unlearn some stuffs about querying DBs as came across prepared statements. Then spent a yr or 2 learning that. Then came across pdo and got even more pissed off why php INC did not delete mysqli_, prepared statements from manual and why they made me learn old stuffs. Now I very angry and unwilling to jump to pdo as by the time I learn it another nonsense will come out and pdo will be museum piece. Hence, once I finish my current projects I quitting php as php is full of old and new stuffs all mixed up. Do not forget I am self learning from home and had to learn things the hard way what is old and what is new. Best, after current projects I ditch php for python as that is new lang and simpler and most likely not riddled with old timers alongside new timers. Won't have to learn and then unlearn to learn a new stuff. Life is short. >>20 at the point of dynamically building the sql query statement, the table and columns names can technically be anything and should be enclosed by back-ticks so as to not produce sql errors.<< Back ticks ? I do not follow you. Care to elaborate with an example code snippet ? >>22. pagination involves two similar queries. the first query is to get the total number of matching rows. the second query is to get the logical page of data. the common part of both of these queries should be built once, in a php variable, with a corresponding array of input parameters. the common part of the query is from the FROM term ... through to any HAVING term. the query to get the total number of matching rows should use SELECT COUNT(*) followed by the common part of the query, i.e. it should NOT select all the data just to get a count of the number of rows of data. the data retrieval query would instead SELECT the columns you want, followed by the common part of the sql query, followed by an ORDER BY term, and then the LIMIT term. you should supply the two LIMIT values via prepared query place holders and add (append/merge) the two values to the array of input values.<< I do not want to use the COUNT() sql here as I have the 3rd TEMPLATE using it. This is TEMPLATE 1 to use mysqli_stmt_num_rows(). Note, I did ask in my op for programmers tpo check if I used that function correctly or not. On my 3rd TEMPLATE thread, I will ask programmers,whether I used the COUNT() sql function correctly or not. On that one, I use mysqli_stmtm_bind() and not mysqli_stmt_get_result(). You do understand what I am doing here, right ? I am using different functions on different TEMPLATES to achieve the same purpose. Build pagination. Then, I can test which TEMPLATE is faster when millions of people are on the same SERP. It's all about experimenting which functions are faster. Hence, kindly grab my code on my op and show me how to use the mysqli_stmt_num_rows(). SELECT id,domain,word,phrase from $tbl WHERE $col_1 = ? OR $col_2 = ? LIMIT $limit OFFSET $offset" And not: SELECT COUNT(id) from $tbl WHERE $col_1 = ? AND $col_2 = ? As latter is on TEMPLATE 3. This thread is about TEMPLATE 1 only. >>23. since you will be using a SELECT COUNT(*) ... query to get the total number of matching rows, you won't need to deal with mysqli's mysqli_stmt_store_result() and mysqli_stmt_num_rows() << No. I have used SELECT COUNT(*) on TEMPLATE 3. Will update it to meet your min standards you have advised on this thread. But on this thread, we deal with mysqli's mysqli_stmt_store_result() and mysqli_stmt_num_rows() as I still want to learn them. Even if they are old. So, do not mind fixing my code and showing me how it should be done so I can see and learn from YOU how things should be done with these 2 particular functions. Once, I embark on a function, I do not quit half way. You do not want me getting in the habit of quitting things half-way so assist me to learn these 2 functions without quitting now for anything else. >>24. don't use a series of name_x variables. use an array. arrays are for sets of data where you will operate on each member in the set in the same/similar way. you can then use php's array functions to operate on the arrays of data.<< I am confused. Why did I use name_x variables that I should have used arrays ? Point me the lines you do not like. Then write the lines how you fancy them. Then, I get rolling to memorise your format. >>25. the pagination link markup should be built in a php variable so that you can output the result wherever and however many times you want. use relative urls in the pagination links. this will eliminate PHP_SELF.<< "link matrkup" ? What is that ? "markup" ? This TEMPLATE 1 builds PAGINATION SECTION like this: $i = 0; while($i<$total_pages) { $i++; if($bool=='and' || $bool=='or') { $serps_url = $_SERVER['PHP_SELF'].'?'.'tbl='.urlencode($tbl).'&'.'col_1='.urlencode($col_1).'&'.'col_2='.urlencode($col_2).'&'.'bool='.$bool.'&'.'input_1='.urlencode($input_1).'&'.'input_2='.urlencode($input_2).'&'.'lmt='.intval($limit).'&'.'pg='.intval($i); } else { $serps_url = $_SERVER['PHP_SELF'].'?'.'tbl='.urlencode($tbl).'&'.'col_1='.urlencode($col_1).'&'.'bool='.urlencode($bool).'&'.'input_1='.urlencode($input_1).'&'.'lmt='.intval($limit).'&'.'pg='.intval($i); } if($i==$page) { echo '<a href="' .htmlspecialchars($serps_url) .'">' ."<b>$i</b>" .'</a>'; //Need to add htmlspecialchars(), to convert '&' to '&amp;', when echoing link here. } else { echo '<a href="' .htmlspecialchars($serps_url) .'">' ."$i" .'</a>'; //Need to add htmlspecialchars(), to convert '&' to '&amp;', when echoing link here. } } Template 2 & 3 uses this instead: $i = 0; while($i<$total_pages) { $i++; if($_GET['bool']=='null') { //Page Format: $_GET List. $array = array("tbl"=>"$tbl","col_1"=>"$col_1","bool"=>"$bool","input_1"=>"$input_1","lmt"=>"$limit","pg"=>intval($i)); } else { //Page Format: $_GET List. $array = array("tbl"=>"$tbl","col_1"=>"$col_1","col_2"=>"$col_2","bool"=>"$bool","input_1"=>"$input_1","input_2"=>"$input_2","lmt"=>"$limit","pg"=>intval($i)); } $serps_url = $_SERVER['PHP_SELF'].'?'.http_build_query($array); if($i==$page) { echo '<a href="' .htmlspecialchars($serps_url) .'">' ."<b>$i</b>" .'</a>'; //Need to add htmlspecialchars(), to convert '&' to '&amp;', when echoing link here. } else { echo '<a href="' .htmlspecialchars($serps_url) .'">' ."$i" .'</a>'; //Need to add htmlspecialchars(), to convert '&' to '&amp;', when echoing link here. } } Now, what do you mean by "markup" ? Point! >>27. to build the query string part of the pagination links, get an existing copy of any $_GET parameters (this will automatically include any table, input, col, bool, and limit values so that you don't need to write out code for each one) set/modify the page (pg) element, then use http_build_query() to build the query string. this will take care of urlencodeing the values.<< One day, I am likely to pester you about urldecode(). CONCLUSION You know, few nights ago, I came to the conclusion that, having these $vars was a big mistake: $input_1 $input_1 $col_1 $col_2 And replacing them with just: $input That will have the tbl, cols, AND/OR, etc. (the whole keyword search). No need to have separate $vars where more than one one for each col and more than one for each BOOL. I should fix all this on my TEMPLATE 1, 2,3 and the LATEST (short pagination). Here, is the thread for the LATEST PAGINATION TEMPLATE (Template 4) or SHORT TEMPLATE. I tried shortening and reusing lines as much as possible. Remember, I worked on it last night before reading your fix advices here and so do not get upset where that thread is not heeding your advice giving here. Ok ? Thank you Mac Guyver! It's nearly sunrise here, I was supposed to fix all my 4 PAGINATION TEMPLATES based on your fix advices here but it took me about 4hrs replying to your reply. Nearly 4:30am here. So, I should work on them the upcoming night. In the meanwhile, do write the example codes I asked for here so that I can add your fixes to my 4 TEMPLATES. And do not worry. I am not the guy just copies codes. I test them, memorise them, then create derivations out of them for further experimenting purposes. I need to start learning the fixes from somewhere. From some example codes. You are my first point of that. Take care and good night, or should I say good morning!
  15. Good Night, This is my pagination script which I built from memory. No copy-pasting from anywhere. And so, it is unorthodox. Trying to shorten the code as much as possible. See if you can shorten it or not using mysqli, prepared statements and procedural style. No OOP or pdo as I do not know them. Oh, and do not repeat yourselves telling me what Mac Guyver has told me over here: Because, once I understand all the things he has advised over there, I will try heeding his advice over on this thread & code too. In the meanwhile, see if this code can be further shortened or not. That is all. Thanks! <?php //TEMPLATE. //FULLY WORKING! //COMPLETE! //mysqli_stmt_store_result(). //mysqli_stmt_free_result(). //$rows_count = mysqli_stmt_num_rows($stmt). //mysqli_stmt_get_result(). //http_build_query(). //Report Error. ini_set('display_errors',1); ini_set('display_startup_errors',1); error_reporting(E_ALL); //Valid $_GET Items. //$tables = array('spidered_web_index','$submitted_web_index','$items_listings','visiting_history','following_history'); $spidered_web_index = array('id','date_and_time','domain','url','title','header','meta_keyword','meta_description','keyword','keyphrase'); $submitted_web_index = array('id','date_and_time','domain','url','title','description','country','keyword','keyphrase'); $items_listings = array('id','date_and_time','item','brand','manufacturer','model','heading','year','description','price','country','keyword','keyphrase'); $visiting_history = array('id','date_and_time','searcher','domain','url','title','header','description','country','meta_keyword','meta_description','keyword','keyphrase'); $following_history = array('id','date_and_time','searcher','follower','domain','url','title','header','description','country','meta_keyword','meta_description','keyword','keyphrase'); $tables = ['spidered_web_index'=> ['id'=>'ID', 'date_and_time'=>'Date & Time', 'domain'=>'Domain', 'domain_point'=>'Domain Point', 'url'=>'Url', 'url'=>'Url Point', 'title'=>'Title', 'title'=>'Title Point', 'heading_1'=>'Heading 1', 'heading_1_point'=>'Heading 1 Point', 'heading_2'=>'Heading 2', 'heading_2_point'=>'Heading 2 Point', 'heading_3'=>'Heading 3', 'heading_3_point'=>'Heading 3 Point', 'heading_4'=>'Heading 4', 'heading_4_point'=>'Heading 4 Point', 'heading_5'=>'Heading 5', 'heading_5_point'=>'Heading 5 Point', 'heading_6'=>'Heading 6', 'heading_6_point'=>'Heading 6 Point', 'keyword_superscript'=>'Keyword Superscript', 'keyword_superscript'=>'Keyword superscript', 'keyword_strong'=>'Keyword Strong', 'keyword_strong'=>'Keyword Strong', 'keyword_emphasised'=>'Keyword Emphasised', 'keyword_emphasised'=>'Keyword Emphasised', 'keyword_bold'=>'Keyword Bold', 'keyword_bold'=>'Keyword Bold', 'keyword_italic'=>'Keyword Italic', 'keyword_italic'=>'Keyword Italic', 'keyword_marked'=>'Keyword Marked', 'keyword_marked'=>'Keyword Marked', 'keyword_inserted'=>'Keyword Inserted', 'keyword_inserted'=>'Keyword Inserted', 'keyword_deleted'=>'Keyword Deleted', 'keyword_deleted'=>'Keyword Deleted', 'keyword_small'=>'Keyword Small', 'keyword_small'=>'Keyword Small', 'keyword_subscript'=>'Keyword Subscript', 'keyword_subscript'=>'Keyword Subscript' ], 'submitted_web_index'=> ['id'=>'ID', 'date_and_time'=>'Date & Time', 'domain'=>'Domain', 'domain_point'=>'Domain Point', 'url'=>'Url', 'url'=>'Url Point', 'title'=>'Title', 'title'=>'Title Point', 'heading_1'=>'Heading 1', 'heading_1_point'=>'Heading 1 Point', 'heading_2'=>'Heading 2', 'heading_2_point'=>'Heading 2 Point', 'heading_3'=>'Heading 3', 'heading_3_point'=>'Heading 3 Point', 'heading_4'=>'Heading 4', 'heading_4_point'=>'Heading 4 Point', 'heading_5'=>'Heading 5', 'heading_5_point'=>'Heading 5 Point', 'heading_6'=>'Heading 6', 'heading_6_point'=>'Heading 6 Point', 'keyword_superscript'=>'Keyword Superscript', 'keyword_superscript'=>'Keyword superscript', 'keyword_strong'=>'Keyword Strong', 'keyword_strong'=>'Keyword Strong', 'keyword_emphasised'=>'Keyword Emphasised', 'keyword_emphasised'=>'Keyword Emphasised', 'keyword_bold'=>'Keyword Bold', 'keyword_bold'=>'Keyword Bold', 'keyword_italic'=>'Keyword Italic', 'keyword_italic'=>'Keyword Italic', 'keyword_marked'=>'Keyword Marked', 'keyword_marked'=>'Keyword Marked', 'keyword_inserted'=>'Keyword Inserted', 'keyword_inserted'=>'Keyword Inserted', 'keyword_deleted'=>'Keyword Deleted', 'keyword_deleted'=>'Keyword Deleted', 'keyword_small'=>'Keyword Small', 'keyword_small'=>'Keyword Small', 'keyword_subscript'=>'Keyword Subscript', 'keyword_subscript'=>'Keyword Subscript' ] , 'links_crawls_drummin' => ['id' => "ID" ,'date_and_time' => "Date and Time" ,'domain' => "Domain" ,'domain_point' => "Domain Point" ,'url' => "URL" ,'url_point' => "Url Point" ,'title' => "Title" ,'title_point' => "Title Point" ,'header' => "Header" ,'header_point' => "Header Point" ,'kw_1' => "Keyword 1" ,'kw_1_point' => "Keyword 1 Point" ,'kw_2' => "Keyword 2" ,'kw_2_point' => "Keyword 2 Point" ,'kw_3' => "Keyword 3" ,'kw_3_point' => "Keyword 3 Point" ,'kw_4' => "Keyword 4" ,'kw_4_point' => "Keyword 4 Point" ,'description' => "Description" ,'description_point' => "Description Point" ], 'links_submits_drummin' => ['id' => "ID" ,'date_and_time' => "Date and Time" ,'domain' => "Domain" ,'domain_point' => "Domain Point" ,'url' => "URL" ,'url_point' => "Url Point" ,'title' => "Title" ,'title_point' => "Title Point" ,'header' => "Header" ,'header_point' => "Header Point" ,'kw_1' => "Keyword 1" ,'kw_1_point' => "Keyword 1 Point" ,'kw_2' => "Keyword 2" ,'kw_2_point' => "Keyword 2 Point" ,'kw_3' => "Keyword 3" ,'kw_3_point' => "Keyword 3 Point" ,'kw_4' => "Keyword 4" ,'kw_4_point' => "Keyword 4 Point" ,'description' => "Description" ,'description_point' => "Description Point" ], ]; //Extract $_GETs. $table = !EMPTY($_POST['tbl'])?$_POST['tbl']:(!EMPTY($_GET['tbl'])?$_GET['tbl']:'spidered_web_index'); $column = !EMPTY($_POST['col'])?$_POST['col']:(!EMPTY($_GET['col'])?$_GET['col']:'id'); $limit = !EMPTY($_POST['lmt'])?$_POST['lmt']:(!EMPTY($_GET['lmt'])?$_GET['lmt']:1); $match = !EMPTY($_POST['mtch'])?$_POST['mtch']:(!EMPTY($_GET['mtch'])?$_GET['mtch']:'fuzzy'); $search = !EMPTY($_POST['srch'])?$_POST['srch']:(!EMPTY($_GET['srch'])?$_GET['srch']:'mobile'); $page = !EMPTY($_GET['pg'])?intval($_GET['pg']):1; $offset = ($page*$limit)-$limit; $headings = array_values($tables[$table]); $columns = array_keys($tables[$table]); echo $columns_count = count($columns); if(!in_array($column,$columns)) { die('Invalid Column!'); } if(!in_array($tables[$table],$tables)) { die('Invalid Table!'); } $search = (!EMPTY($search) && $match==='fuzzy')?str_replace('*','%',$search):$search; $char_types = str_repeat('s',$columns_count); $search_values = array_fill(0,$columns_count,$search); $comparator = ($match==='exact')?'=':'LIKE'; $sql = "SELECT * FROM $table WHERE " .implode(" $comparator ? OR ",$columns) ." $comparator ? "; $sql .= "ORDER BY id DESC LIMIT $limit OFFSET $offset"; //Query DB. mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $conn = mysqli_connect("localhost","root","","buzz"); //mysqli_connect("server","user","password","db"); mysqli_set_charset($conn,'utf8mb4'); if(mysqli_connect_errno()) { printf("Mysqli Connection Error: %s",mysqli_connect_error()); } $stmt = mysqli_stmt_init($conn); if(!mysqli_stmt_prepare($stmt,$sql)) //Fetch Rows based on Row Limit per page. { echo 'Mysqli Error: ' .mysqli_stmt_error($stmt); echo '<br>'; echo 'Mysqli Error No: ' .mysqli_stmt_errno($stmt); } else { mysqli_stmt_bind_param($stmt,$char_types,...$search_values); mysqli_stmt_execute($stmt); mysqli_stmt_store_result($stmt); //Necessary to use with mysqli_stmt_num_rows() when SQL query is SELECT. echo '<br><br>';echo '<br><br>';echo '<br><br>';echo '<br><br>'; //Fetch Matching Rows Count. //mysqli_stmt_num_rows() has to come after mysqli_stmt_store_result(). echo 'Total Result: ' .$rows_count = mysqli_stmt_num_rows($stmt); echo '<br><br>'; mysqli_stmt_free_result($stmt); //Is this really necessary ? if(!mysqli_stmt_prepare($stmt,$sql)) //Fetch Rows based on Row Limit per page. { echo 'Mysqli Error: ' .mysqli_stmt_error($stmt); echo '<br>'; echo 'Mysqli Error No: ' .mysqli_stmt_errno($stmt); } else { mysqli_stmt_bind_param($stmt,$char_types,...$search_values); mysqli_stmt_execute($stmt); $result = mysqli_stmt_get_result($stmt); mysqli_stmt_free_result($stmt); //Is this really necessary ? while($row = mysqli_fetch_array($result,MYSQLI_ASSOC)) { for($i=0;$i<$columns_count;$i++) { echo '<b>'.$headings[$i].': </b>'.$row[$columns[$i]]; echo '<br>'; } } } } mysqli_stmt_close($stmt); mysqli_close($conn); echo 'Total Pages: ' .$total_pages = ceil($rows_count/$limit); echo '<br><br>'; $i = 0; while($i<$total_pages) { $i++; $pagination_section_array = array("tbl"=>"$table","mtch"=>"$match","lmt"=>"$limit","srch"=>"$search","pg"=>intval($i)); $serps_url = $_SERVER['PHP_SELF'].'?'.http_build_query($pagination_section_array,'','&amp;'); //Did convert '&' to '&amp' and so NO need to add htmlspecialchars() when echoing link. if($i==$page) { echo '<a href="' .$serps_url .'">' ."<b>$i</b>" .'</a>'; //No need to add htmlspecialchars(), to convert '&' to '&amp;', when echoing link here. } else { echo '<a href="' .$serps_url .'">' ."$i" .'</a>'; //No need to add htmlspecialchars(), to convert '&' to '&amp;', when echoing link here. } } echo '<br>'; ?>
  16. $test = array('id','date_and_time','kw_1','kw_1_point','kw_2','kw_2_point','kw_3','kw_3_point','kw_4','kw_4_point'); Q2. How to check all the values to see if any of them DOES contain '_'. How to do a wildcard check with php here ? No need to echo anything here like the previous question.
  17. Hi, $test = array('id','date_and_time','kw_1','kw_1_point','kw_2','kw_2_point','kw_3','kw_3_point','kw_4','kw_4_point'); Q1. How to echo all the values that does not conatin '_point'.
  18. @MacGuyver Thanks for the lengthy feed-back. I actually did not test the above code. If I copy the original code here that I tested, it might be too long and you people might mind and not bother looking into it. And so, I shortened it in a rush lastnight, changing the arrays and their values by copying them from a new project I am working on, before posting it here when I was about to shut down my laptop for the night as sleep was in my eyes. Hence, you are finding typos. The main body of the script had been tested and working before I made the array changes lastnight as the script was built like 6 mnths ago and it was working. After making lastnight's changes in the array names and values, I did not fully test it. So, you are spot on here! As for me fixing it with all your fixes tonight, that I am afraid I cannot do overnight as there is a lot to digest of what fix advices you gave above. I just read your fixes once. Will probably have to read about 5 times before everything sinks in. Ok ? Oh yes, by the way, I actually built many PAGINATION scripts. Each of them coded using different functions from each other. 1. This particular thread is about the PAGINATION (Template 1) I built using these functions: //mysqli_stmt_store_result(). //mysqli_stmt_free_result(). //$rows_count = mysqli_stmt_num_rows($stmt). //mysqli_stmt_get_result(). //urlencode(). //rawurlencode(). //htmlspecialchars(). 2. I have built another 2nd PAGINATION script (Template 2) using the following functions. I will open another thread regarding it. //mysqli_stmt_store_result(); //mysqli_stmt_free_result(); //$rows_count = mysqli_stmt_affected_rows($stmt); //mysqli_stmt_get_result(); //urlencode(). //rawurlencode(). //htmlspecialchars(). 3. I have built another 3rd PAGINATION script (Template 3) using the following functions. I will open another thread regarding it. //SQL COUNT(); //mysqli_stmt_bind_result(). //http_build_query(). The differences between each of the 3 scripts are marked above in bold. Look-out for my upcoming threads regarding them. Bear in mind, I built these 3 templates last year. Probably 6-12mnths ago. I did not think they were faulty. Lastnight, thought best I get them checked here before building any website. And so, doing that. To see what the PROS say. So, why did I build 3 different PAGINATIONs. Just experimenting with different functions (bold ones above). That is how I learn how to use different functions. I test, experiment, play, fiddle, compare, etc. That is how I gain work experience. Anyway, did I miss your answers or did you forget to answer them ? Look at my original post for my questions. I need to know their answers. That is why I opened this thread. If I missed your answers, can you kindly point them out to me ? Thanks!
  19. Tech Experts, I have been seeing youtube videos about ChatGPT3 but the link was not working few weeks ago and so I quit it. Tonight looking into it again. Do you people know how I can use ChatGPT 3 or 4 for free, unlimited with unrestricted use ? Or maybe, you know of better ones you have tried yourselves ? I am only interested in those that have no limits, restrictions of use. Or, the limit must be high enough to satisfy me for the day. I just saw the following video on how to use ChatGPT4 for free but it is restricted. It says at the end that, I can use ChatGPT 4 via bing.com. But is not clear if I can use UNLIMITED & UNRESTRICTED OR NOT. By unlimited, I mean, I should be able to use as often as I like per session and as much sessions per day, week, month I want. By unrestriction, I mean, I should be able to use it whenever I want. Not have to wait for any particular time to use it. Anyways, if you know of any good ones or trial ones with high limits, that can write web apps (php), .exe desktop softwares (C/C++, Java), css, html5 then let me know. Better, if they can review and mark my php, css, html5 codes too. I am spoiled for choice. Too many youtube vids on these AIs. Hardly, you can remember them all. Spoiled for choice which companies to give a go and which ones to avoid like the plague. So, best I ask you! What you say ? Anything else I should know ? Btw, don't think I am going to let you off that easy. You better tell me what you been upto with these AIs. Upto some mischief perhaps ? Now, don't go getting them to hack into others systems. Lol! And do suggest me what I should do with them to play around, experiment, test, etc. To have FUN! And how I should get them to work for me for them to earn me money online.
  20. Hiya, Check this PAGINATION out that I built! What you think ? Built from scratch I did and is working fine to query my Mysql DB and show results. However, I need your feed-back to know if I managed to use the functions in the correct order or not. //FUNCTIONS IN USE TO QUERY DATABASE: //mysqli_stmt_store_result(). //mysqli_stmt_free_result(). //$rows_count = mysqli_stmt_num_rows($stmt). //mysqli_stmt_get_result(). //FUNCTIONS IN USE TO BUILD PAGINATION SECTION //urlencode(). //rawurlencode(). //htmlspecialchars(). I have a few questions. Q1. Is it true that, I need to use mysqli_stmt_store_result($stmt) prior to using mysqli_stmt_num_rows($stmt) ? Q2. Is it true that, I need to use mysqli_stmt_free_result($stmt) after every mysqli_stmt_store_result($stmt) ? <?php //FUNCTIONS IN USE TO QUERY DATABASE: //mysqli_stmt_store_result(). //mysqli_stmt_free_result(). //$rows_count = mysqli_stmt_num_rows($stmt). //mysqli_stmt_get_result(). //FUNCTIONS IN USE TO BUILD PAGINATION SECTION //urlencode(). //rawurlencode(). //htmlspecialchars(). //Report Error. ini_set('display_errors',1); ini_set('display_startup_errors',1); error_reporting(E_ALL); //Valid $_GET Items. $tbls = array('spidered_web_index','$submitted_web_index'); $spidered_web_index = array('id','date_and_time','domain','url','title','header','meta_keyword','meta_description','keyword','keyphrase'); $submitted_web_index = array('id','date_and_time','domain','url','title','description','country','keyword','keyphrase'); //Extract $_GETs. $tbl = !EMPTY($_POST['tbl'])?strtolower($_POST['tbl']):(!EMPTY($_GET['tbl'])?strtolower($_GET['tbl']):'listed_links'); $input_1 = !EMPTY($_GET['input_1'])?$_GET['input_1']:die('Make your input for us to search!'); $input_2 = !EMPTY($_GET['input_2'])?$_GET['input_2']:null; $col_1 = !EMPTY($_GET['col_1'])?strtolower($_GET['col_1']):die('Input MySql Column to search!'); $col_2 = !EMPTY($_GET['col_2'])?strtolower($_GET['col_2']):null; $bool = !EMPTY($_GET['bool'])?strtolower($_GET['bool']):null; $page = !EMPTY($_GET['pg'])?intval($_GET['pg']):1; $limit = !EMPTY($_GET['lmt'])?intval($_GET['lmt']):1; $offset = ($page*$limit)-$limit; if(ISSET($col_2)) { if(!in_array($col_2,$links_table_columns)) { die('Invalid Mysql Table!'); } } if(!in_array($col_1,$links_table_columns)) { die('Invalid Mysql Table!'); } //Query DB. mysqli_report(MYSQLI_REPORT_ERROR|MYSQLI_REPORT_STRICT); $conn = mysqli_connect("localhost","root","","buzz"); //mysqli_connect("server","user","password","db"); mysqli_set_charset($conn,'utf8mb4'); if(mysqli_connect_errno()) { printf("Mysqli Connection Error: %s",mysqli_connect_error()); } $stmt = mysqli_stmt_init($conn); if($bool=='and') { $input_1 = $_GET['input_1']; $input_2 = $_GET['input_2']; $sql_count = "SELECT id,domain,word,phrase from $tbl WHERE $col_1 = ? AND $col_2 = ?"; $sql = "SELECT id,domain,word,phrase from $tbl WHERE $col_1 = ? AND $col_2 = ? LIMIT $limit OFFSET $offset"; } elseif($bool=='or') { $input_1 = $_GET['input_1']; $input_2 = $_GET['input_2']; $sql_count = "SELECT id,domain,word,phrase from $tbl WHERE $col_1 = ? OR $col_2 = ?"; $sql = "SELECT id,domain,word,phrase from $tbl WHERE $col_1 = ? OR $col_2 = ? LIMIT $limit OFFSET $offset"; } else { $input_1 = $_GET['input_1']; $sql_count = "SELECT id,domain,word,phrase from $tbl WHERE $col_1 = ?"; $sql = "SELECT id,domain,word,phrase from $tbl WHERE $col_1 = ? LIMIT $limit OFFSET $offset"; } if(!mysqli_stmt_prepare($stmt,$sql_count)) //Fetch All Matching Rows Number. { echo 'Mysqli Error: ' .mysqli_stmt_error($stmt); echo '<br>'; echo 'Mysqli Error No: ' .mysqli_stmt_errno($stmt); } else { if($bool=='and' || $bool=='or') { mysqli_stmt_bind_param($stmt,"ss",$input_1,$input_2); } else { mysqli_stmt_bind_param($stmt,"s",$input_1); } mysqli_stmt_execute($stmt); mysqli_stmt_store_result($stmt); //Necessary to use with mysqli_stmt_num_rows() when SQL query is SELECT. //Fetch Matching Rows Count. //mysqli_stmt_num_rows() has to come after mysqli_stmt_store_result(). echo 'Total Result: ' .$rows_count = mysqli_stmt_num_rows($stmt); echo '<br><br>'; mysqli_stmt_free_result($stmt); //Is this really necessary ? } if(!mysqli_stmt_prepare($stmt,$sql)) //Fetch Rows based on Row Limit per page. { echo 'Mysqli Error: ' .mysqli_stmt_error($stmt); echo '<br>'; echo 'Mysqli Error No: ' .mysqli_stmt_errno($stmt); } else { if($bool=='and' || $bool=='or') { mysqli_stmt_bind_param($stmt,"ss",$input_1,$input_2); } else { mysqli_stmt_bind_param($stmt,"s",$input_1); } mysqli_stmt_execute($stmt); $result = mysqli_stmt_get_result($stmt); while($row = mysqli_fetch_array($result,MYSQLI_ASSOC)) { $id = $row['id']; $domain = $row['domain']; $word = $row['word']; $phrase = $row['phrase']; echo "$id<br>"; echo "$domain<br>"; echo "$word<br>"; echo "$phrase<br>"; echo "<br>"; } } mysqli_stmt_close($stmt); mysqli_close($conn); echo 'Total Pages: ' .$total_pages = ceil($rows_count/$limit); echo '<br><br>'; $i = 0; while($i<$total_pages) { $i++; if($bool=='and' || $bool=='or') { $serps_url = $_SERVER['PHP_SELF'].'?'.'tbl='.urlencode($tbl).'&'.'col_1='.urlencode($col_1).'&'.'col_2='.urlencode($col_2).'&'.'bool='.$bool.'&'.'input_1='.urlencode($input_1).'&'.'input_2='.urlencode($input_2).'&'.'lmt='.intval($limit).'&'.'pg='.intval($i); } else { $serps_url = $_SERVER['PHP_SELF'].'?'.'tbl='.urlencode($tbl).'&'.'col_1='.urlencode($col_1).'&'.'bool='.urlencode($bool).'&'.'input_1='.urlencode($input_1).'&'.'lmt='.intval($limit).'&'.'pg='.intval($i); } if($i==$page) { echo '<a href="' .htmlspecialchars($serps_url) .'">' ."<b>$i</b>" .'</a>'; //Need to add htmlspecialchars(), to convert '&' to '&amp;', when echoing link here. } else { echo '<a href="' .htmlspecialchars($serps_url) .'">' ."$i" .'</a>'; //Need to add htmlspecialchars(), to convert '&' to '&amp;', when echoing link here. } } echo '<br>'; ?> On the above code, search for the comment: //Is this really necessary here ? And answer that question. Q3. Anything else I need to know apart from I should use pdo ? Q4. Is my code bad, ok, good or great ? I reckon it is ok. Thanks
  21. Web Developers, Can you recommend me a vps host that provides unlimited & unmetered bandwidths ? Will be running my own searchengine. Currently, building one. Bear in mind that, gonna start small and so do not want to rent a dedicated server just yet as need to see first if my venture picks up or not. Otherwise, waste of money. Not interested in cloud hosting as of yet. Which vps host and their pack do you recommend ?
  22. @requinix Issue solved. Do close this thread. Thanks!
  23. I do not know pdo but still thanks.
  24. @ginerjm Barand saved the night!
×
×
  • 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.